SOLVED Batch file won't tun


Joined
Sep 27, 2020
Messages
3
Reaction score
0
I’ve been using batch files for many years: Prepare a text file. Change its extension to .BAT. Click and the batch file runs.

Now with Windows 10 64 bit I find that doesn’t work. It seems the system just won’t recognise that this is a batch file and so doesn’t run it. I’ve tried with extension.CMD, and tried from the command prompt.

How do I solve this?
 
Ad

Advertisements

Joined
Oct 2, 2014
Messages
1,757
Reaction score
405
Did you run the command prompt as admin (right click on the command prompt icon, and select "run as admin")? You should be able to run the .bat file by typing the path. I have to admit, I haven't run a batch file since Windows 7, but there's no reason it shouldn't work in 10.
 
Joined
Sep 27, 2020
Messages
3
Reaction score
0
Thanks, I've done that running as admin now, but I still get this message:
xyz.bat is not recognized as an internal or external command, operable program or batch file

Same with cmd.

BTW Formerly when I changed the text file's extension to bat before running it, I always got a message 'Are you sure?'
Now there is no such message, as if the system was changing the extension but not changing the file's type to batch file.
 
Joined
Mar 7, 2020
Messages
246
Reaction score
29
As you have used batch files for years, that you checked that file/program the .bat file refers too is currently saved on the "C" drive of your computer.
 
Joined
Sep 26, 2017
Messages
2,982
Reaction score
583
I'm not having any issue running creating and running simple .bat files on the latest Win10.
 
Joined
Feb 22, 2014
Messages
1,601
Reaction score
335
Two things I can think of in addition to what has been mentioned.
  1. Check file associations for bat/cmd
  2. Check that the bat/cmd is saved as text only and not saved with a special format.
 
Ad

Advertisements

Joined
Sep 27, 2020
Messages
3
Reaction score
0
This is what I've now found:
Make your batch file with Notepad++ and it will run.
Make your batch file with Word saved as text or with Wordpad or with anything else, and it won't run.
My experience.
 
Joined
Jun 4, 2022
Messages
1
Reaction score
0
I have a slightly different situation. I can start a new thread; I'm trying here, since this is where the Google search leads.

In my case, "Batch file won't run" means that a specific batch file won't run. Other batch files in the same folder run fine. This is in Win10 x64.

I suspect the problem is antivirus. Bitdefender indicated that it was flagging the file. The file is unremarkable; content similar to other batch files; been running batch files for decades. I told Bitdefender to restore. Still didn't work, so I replaced Bitdefender with Norton. That solitary batch file continues not to work. Did a registry search for the batch file's name; saw nothing unusual. Rebooted as part of the transition to Norton.

Ideas?
 
Ad

Advertisements

Joined
Sep 26, 2017
Messages
2,982
Reaction score
583
It may help to see the contents of that .bat file, could be it is calling a program or file that is causing the issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top