Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can´t run .bat file under windows 10 [closed]

Tags:

batch-file

I have few .bat files that I used under Windows XP. Now I want to use them under Windows 10, but when I run one of the files (even as administrator) it shows the command prompt screen for 1 second and nothing happens.

Can someone help me please?

like image 428
Killahtm Avatar asked Aug 29 '16 13:08

Killahtm


People also ask

Why isn't my BAT file is not running?

It's possible that the user has inadvertently associated . bat files with a text editor, or associated . bat files with cmd.exe , or tampered with the settings in the registry.

Do BAT files work in Windows 10?

Windows 10 has at least three ways to write batch files. You can run them on-demand using Command Prompt or File Explorer. You can configure the script using the Task Scheduler app to run it on schedule.

How do I open a .BAT file in Windows 10?

A BAT file is a Windows Batch file. Double-click to run it, or open it with Notepad for editing.


1 Answers

There is no inherent reason that a simple batch file would run in XP but not Windows 10. It is possible you are referencing a command or a 3rd party utility that no longer exists. To know more about what is actually happening, you will need to do one of the following:

  • Add a pause to the batch file so that you can see what is happening before it exits.
    1. Right click on one of the .bat files and select "edit". This will open the file in notepad.
    2. Go to the very end of the file and add a new line by pressing "enter".
    3. type pause.
    4. Save the file.
    5. Run the file again using the same method you did before.

- OR -

  • Run the batch file from a static command prompt so the window does not close.
    1. In the folder where the .bat files are located, hold down the "shift" key and right click in the white space.
    2. Select "Open Command Window Here".
    3. You will now see a new command prompt. Type in the name of the batch file and press enter.

Once you have done this, I recommend creating a new question with the output you see after using one of the methods above.

like image 164
THE JOATMON Avatar answered Oct 10 '22 07:10

THE JOATMON