Solved .bat files not running ..?


m0zzy

New member
Local time
12:36 PM
Posts
7
OS
Windows 11
Im signed up to this forum in a desperate attempt to fix this without having to reinstall windows 11 again ..
so is i REALLY hope someone can help / fix this ... long story short ...>
Capture.PNG

when i run a .bat file, its saying that .. ^^^
Ive searched and tried EVERYTHING for 2 days trying to fix it ..
its like Windows doesnt know what a .bat file is ..
Its saying it 'cannot find' even tho ive obviously just double clicked on it ..
Please OB1, u are my only hope ........
(If theres anything been put on the 'net within the last 2 yrs, ive tried it .. )

Thanks in advance ..
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    PC Specialist
Make a copy of the .bat file and change it to a .txt file. Look at it in notepad or similar and check that where it is looking. In that example above it is showing your 'D' drive. I'm guessing Windows is stored on your 'C' drive. Just alter the 'D' to 'C' and change its name back to .bat. Right click the .bat file and choose run as administrator.

EDIT: Have you checked that path to see if the file actually exists? It's running the .bat file but not finding the path in it.
 

My Computer

System One

  • OS
    Windows 11 Pro Version 23H2 OS Build 22631.3374
    Computer type
    PC/Desktop
    Manufacturer/Model
    Local shop built (KC Computers Ltd)
    CPU
    Intel Core i9 13900F
    Motherboard
    Gigabyte Z690 Gaming X (rev. 1.0/1.1) - (BIOS: F29 Dec 22, 2023)
    Memory
    2 x Kingston Fury 32gb DDR5 5600 Beast
    Graphics Card(s)
    Gigabyte Eagle (Nvidia) RTX 3060
    Sound Card
    Chord Async USB 44.1kHz - 384kHz 2Qute DAC
    Monitor(s) Displays
    piXL PX27UDH4K 27 Inch Frameless IPS Monitor
    Screen Resolution
    4K (3840 x 2160) 60fps
    Hard Drives
    1 x KINGSTON NVMe M.2 SSDSKC3000D2048G 2TB
    1 x Samsung SSD 870 EVO 250GB
    2 x Crucial CT4000MX500SSD1 4TB
    2 x Crucial CT2000MX500SSD1 2TB
    1 x Crucial CT250MX500SSD1 250.0 GB
    PSU
    Gigabyte 750w
    Case
    Fractal Torrent
    Cooling
    Stock Intel CPU, 2 x Fractal 180mm PWM (front), 3 x Fractal 140mm PWM (bottom)
    Keyboard
    Logitech MX Mechanical Wireless Illuminated Performance Keyboard
    Mouse
    Logitech MX Master 3S Wireless Performance Mouse
    Internet Speed
    960 Mbps/330 Mbps Trooli FTTP
    Browser
    Firefox
    Antivirus
    Eset Nod32
Im signed up to this forum in a desperate attempt to fix this without having to reinstall windows 11 again ..
so is i REALLY hope someone can help / fix this ... long story short ...>
View attachment 87482

when i run a .bat file, its saying that .. ^^^
Ive searched and tried EVERYTHING for 2 days trying to fix it ..
its like Windows doesnt know what a .bat file is ..
Its saying it 'cannot find' even tho ive obviously just double clicked on it ..
Please OB1, u are my only hope ........
(If theres anything been put on the 'net within the last 2 yrs, ive tried it .. )

Thanks in advance ..
Hi @m0zzy , welcome,
One question: Do you CCleaner by any chance?
 

My Computers

System One System Two

  • OS
    Win11 All /Debian/Arch
    Computer type
    Laptop
    Manufacturer/Model
    ASUSTeK COMPUTER INC. TUF Gaming FX705GM
    CPU
    2.20 gigahertz Intel i7-8750H Hyper-threaded 12 cores
    Motherboard
    ASUSTeK COMPUTER INC. FX705GM 1.0
    Memory
    24428 Megabytes
    Graphics Card(s)
    Intel(R) UHD Graphics 630 / NVIDIA GeForce GTX 1060
    Sound Card
    Intel(R) Display Audio / Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (17.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9
    Hard Drives
    2 SSD SATA/NVM Express 1.3
    WDS500G2B0A-00SM50 500.1 GB
    WDCSDAPNUW-1002 256 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & ADSL Bouygues -fr
    Browser
    Edge Canary- Firefox Nightly
    Antivirus
    Windows Defender
    Other Info
    VMs of Windows 11 stable/Beta/Dev/Canary
    VM of XeroLinux- Arch based & Debian 12
  • Operating System
    Windows 11 Insider Canary
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM
Create some innocuous text file in that folder & double-click on it. This should prove that the problem is not a folder path problem.
Then try creating another batch file in the same folder [a simple one such as one just containing a Pause command] to see if that has the same problem.

I think your problem might well be a PathExt [system variable] problem because its symptoms match.
Run this command in a Command prompt window
echo %PathExt%
Its response should include
.bat
showing that it knows .bat files are things to be run.
A typical response is
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

If this does prove to be the cause of your problem, you'll need to restore the value of this environment variable. See
List of Environment Variables - TenForumsTutorials
List of Environment Variables - ElevenForumTutorials
Set New User and System Environment Variables - TenForumsTutorials
Path, PathExt - SS64

PathExt is also referred to in Command shell overview - MSDocs and discussed in Order in which command prompt executes files with the same name (a.bat vs a.cmd vs a.exe) - Stack Overflow


All the best,
Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3447
This has been marked as solved without explanation. That doesn't help others visiting here looking for an answer.

Anyhow, I found this interesting discussion on Superuser, but again, no clear answer:

The usual reason, in my experience, is interference from AV software, but I'm open to other explanations.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
Whoa, sorry ... i went out not expecting so much help .. so THANKS EVERYONE ..
short story long ..>
I got a new computer in Nov, I make games as an hobby so i installed GameMaker Studio, and it needs
Microsoft Visual Studio, GMS has its own built in Compiler, but uses MVS to compile 'better' .. so within
GMS, you point it to a MSV .bat file for it to use its compiler,.. In Nov, this all worked perfectly, but for some reason,
now it doesnt, i just dont know what ive done between then and now...
THanks in advance ..
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    PC Specialist
Make a copy of the .bat file and change it to a .txt file. Look at it in notepad or similar and check that where it is looking. In that example above it is showing your 'D' drive. I'm guessing Windows is stored on your 'C' drive. Just alter the 'D' to 'C' and change its name back to .bat. Right click the .bat file and choose run as administrator.

EDIT: Have you checked that path to see if the file actually exists? It's running the .bat file but not finding the path in it.
I select it within GM preferences for it to use it, so GM knows its there.. and MVS was originally on the D: drive, when it originally didnt work, so i REinstalled MVS onto the C: drive and still doesnt work,
I have tried to run the .bat file on its own, and it gives me the same error, or aany other .bat file ...
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    PC Specialist
Create some innocuous text file in that folder & double-click on it. This should prove that the problem is not a folder path problem.
Then try creating another batch file in the same folder [a simple one such as one just containing a Pause command] to see if that has the same problem.

I think your problem might well be a PathExt [system variable] problem because its symptoms match.
Run this command in a Command prompt window
echo %PathExt%
Its response should include
.bat
showing that it knows .bat files are things to be run.
A typical response is
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

If this does prove to be the cause of your problem, you'll need to restore the value of this environment variable. See
List of Environment Variables - TenForumsTutorials
List of Environment Variables - ElevenForumTutorials
Set New User and System Environment Variables - TenForumsTutorials
Path, PathExt - SS64

PathExt is also referred to in Command shell overview - MSDocs and discussed in Order in which command prompt executes files with the same name (a.bat vs a.cmd vs a.exe) - Stack Overflow


All the best,
Denis
I did ^^ that, and this was the outcome > C:\Users\m0zzy>echo %PathExt%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC ..
so the .bat is there ...
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    PC Specialist
So why have you marked this thread as solved?
If it was by accident, just un-solve it so people know you still want help.


You commented on the third test I suggested.
What were the results of the first two tests?


Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3447
So why have you marked this thread as solved?
If it was by accident, just un-solve it so people know you still want help.


You commented on the third test I suggested.
What were the results of the first two tests?


Denis
Sorry, i didnt realise i had..
Sorry, but it says .. "If this does prove to be the cause of your problem" ..
and the first test proved to not be the cause of the problem ..
It isnt just the one .bat file, its any of them in any folder ..
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    PC Specialist
Just a weird thought, have you tried putting the .bat file on the Desktop and run from there for testing? I've seen times where a .bat file wouldn't work when it was in the folder mentioned in the Path, something about not regressing to the beginning.
 

My Computers

System One System Two

  • OS
    Win11 Pro RTM
    Computer type
    Laptop
    Manufacturer/Model
    Dell Vostro 3400
    CPU
    Intel Core i5 11th Gen. 2.40GHz
    Memory
    12GB
    Hard Drives
    256GB SSD NVMe
  • Operating System
    Windows 11 Pro RTM x64
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Vostro 5890
    CPU
    Intel Core i5 10th Gen. 2.90GHz
    Memory
    16GB
    Graphics card(s)
    Onboard, no VGA, using a DisplayPort-to-VGA adapter
    Monitor(s) Displays
    24" Dell
    Hard Drives
    512GB SSD NVMe, 2TB WDC HDD
    Browser
    Firefox, Edge
    Antivirus
    Windows Defender/Microsoft Security
WELL!!!! ... I will Eat My Hat!!!
This has been marked as solved without explanation. That doesn't help others visiting here looking for an answer.

Anyhow, I found this interesting discussion on Superuser, but again, no clear answer:

The usual reason, in my experience, is interference from AV software, but I'm open to other explanations.
I looked in ^^^ THAT Forum, and someone right at the bottom says they just copied the
cmd.exe from his other computer and it worked .. so i tried that ..
*** It worked *** , tho ... my laptop has W10 and this is W11 .. would that matter .?

THANKS ALL..!!
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    PC Specialist
** It worked *** , tho ... my laptop has W10 and this is W11 .. would that matter .?
I've found most things that work on Win10 will also work on Win11. Many things within Win11 still identify as Win10.
 

My Computers

System One System Two

  • OS
    Win11 Pro RTM
    Computer type
    Laptop
    Manufacturer/Model
    Dell Vostro 3400
    CPU
    Intel Core i5 11th Gen. 2.40GHz
    Memory
    12GB
    Hard Drives
    256GB SSD NVMe
  • Operating System
    Windows 11 Pro RTM x64
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Vostro 5890
    CPU
    Intel Core i5 10th Gen. 2.90GHz
    Memory
    16GB
    Graphics card(s)
    Onboard, no VGA, using a DisplayPort-to-VGA adapter
    Monitor(s) Displays
    24" Dell
    Hard Drives
    512GB SSD NVMe, 2TB WDC HDD
    Browser
    Firefox, Edge
    Antivirus
    Windows Defender/Microsoft Security

Latest Support Threads

Back
Top Bottom