2

My problem is that when i double click a .bat file it doesn't get opened by cmd and i get this error message:

"Windows cannot find 'C:\users\ (my name)\Desktop\test.bat'. Make sure you typed the name correctly, and then try again". They can still be executed with run as administrator, but it's annoying.

I already looked around and many posts says it's a problem of environment variables, but some things I already tried didn't help. Some said it was a problem of registry keys, i tried this .reg file to fix up:

Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat]
[-HKEY_CURRENT_USER\Software\Classes\.bat]
[-HKEY_CURRENT_USER\SOFTWARE\Classes\batfile]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.bat]
@="batfile"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\open\command]
@="\"%1\" %*"

but the error still appears.

I had to change the env.variables to install some things and i do think i might have messed up, but I can't understand if now they are correct again or not, so if you could tell me...here are the current values of ComSpec and PATH:

ComSpec

C:\Windows\System32\cmd.exe;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;

PATH:

C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\1. altro\Git\cmd;D:\1. altro\APACHE-MAVEN\bin;

3
  • @harrymc no, i already had stumbled by that post, i used the restore.reg file proposed in that comment section but the error still happens
    – wattbatt
    Mar 13, 2020 at 9:34
  • @wattbatt From this answer comment I was successful by removing only the UserChoice subfolder. Once it was gone, the default Execute behavior was restored. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat\UserChoice, probably after they worked on ("remove registry settings underneath this key"): HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat key too.
    – Hastur
    Mar 13, 2020 at 10:02
  • Look at all the answers and comments in the linked post.
    – harrymc
    Mar 13, 2020 at 10:21

0

Browse other questions tagged .