Share via

Cannot Open .bat programs.

Anonymous
2011-12-21T19:37:21+00:00

Hi, I have several .bat programs I need to open but my Win7 64bit refuses to open them. All the .bat programs are in a folder. When I go to open them (double-click on them) I get this error: "Windows cannot find 'C:\Users\Home\Desktop\MCP\Decompile.bat. Make sure you typed the name correctly and try again." That is the file I try to open and the error that comes up. I could open it before, but I think something happened that I can't now and I can't remember. I am the admin of the computer and the only user. Help?

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-02-12T23:01:42+00:00

If you are still having issues with opening.bat files on a 64bit, computer this might be a fix.

I ran in to an issue when using some legacy .bat.exe application this resolved my issues.

Copy your .bat files to the x86 program files.

Right click your .bat file and select to create a shortcut

Create a folder on your Desktop or C:\drive and added your .bat file and the newly created x86 shortcut.

THis will allow the .bat file to use x86 directory for .bat execution

Example:

"C:\Program Files (x86)\v2.0 mod\v2.0 mod.bat"

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

9 additional answers

Sort by: Most helpful
  1. Anonymous
    2015-07-31T15:20:39+00:00

    I just ran into this issue. I have bat files in specific locations because of what different scripts are far and how they get handled by version control.  

    Having to move all my bat files to "C:\Program Files (x86)" is just a terrible hack.

    Is there no one from Microsoft here who can offer a real solution (that is, get back the original behavior)?

    What's odd is that I can run bat files fine from the command line.  The folders for my scripts are on my PATH and I can run these scripts from any directory.  Something in Windows knows how to execute a file with the .bat extension.    It seems something got borked with the file manager.

    Update:

    I fixed this on my machine.  

    Somehow (perhaps a faulty installer script, perhaps I screwed something up) the value of the COMSPEC environment variable was altered.  (In my case it looks like someone or something treated it like the PATH variable and appended another file path.   Much as it pains me I am inclined to assume PEBKAC. OTOH the other day I had to do a hard reset because the machine was wedged so perhaps something got corrupted.)

    Ordinarily the COMSPEC variable should look like this:  

         %SystemRoot%\system32\cmd.exe

    If this is not the path to your shell program then sadness follows.

    I fixed the value and all was well again.

    I discovered this because I noticed that some other command line things no longer worked, and in looking for an answer I came across this post: 

    http://www.codeotel.com/CHVjXUeegq/when-using-pipe-getting-the-filename-directory-name-or-volume-label-syntax-is-incorrect.html

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2011-12-23T23:51:00+00:00

    Well it will not open from any file on my computer. I've opened it before, and on other computers. Like I said, I've opened it before but something happened that I can't open it now. I have a feeling I'm missing something in regedit. Will restoring my computer to factory settings work?

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2011-12-23T04:19:03+00:00

    I did that but when I import it I get, "Some keys are open by the system or other programs. Did write all files correctly."

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2011-12-22T08:52:38+00:00

    You may have to restore the .bat association here  http://www.winhelponline.com/blog/file-asso-fixes-for-windows-7/

    Was this answer helpful?

    0 comments No comments