Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Can't open .bat file

09 Jun 2014   #11

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM

Add a pause command so the CMD window will stay open and you can see the error message(s) !!!

My System SpecsSystem Spec
09 Jun 2014   #12

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM

Here is a very simple bat file i just created.
The 1st command is dir - a valid command
The 2nd command is dirt - an invalid command
The 3rd command is pause - so I can see the error


Here is a screen print showing the bat file error, because I have the pause command:

Can't open .bat file-bfesp01.png

My System SpecsSystem Spec
09 Jun 2014   #13

Windows 10 Pro X64

Put the pause in as the last line of the batch file as you were asked to do. That will keep the window from closing so you can see what the error is.

As for my question. To open a Elevated Command prompt, click on Start, type cmd. Right click on cmd.exe at the top left of the Start window and select Run as Administrator.

In the Command Prompt window,

Type echo %pathext% and press Enter.

Result should look like this:

>echo %pathext%
My System SpecsSystem Spec

09 Jun 2014   #14

W10 Pro desktop, W10 laptop, W10 laptop, W10 Pro tablet (all 64-bit)

Since we don't know hat the .bat file is trying to do, we have no way of knowing how to advise you.

You say the .bat file crashes when you run it because the command window opens then closes. That is the expected result of running a .bat file by double-clicking it unless something in the .bat file prevents that such as a pause prior to the .bat file ending which will prevent the command window from closing and perhaps allow you to see if there have been errors outputted to the command window.

Would it be possible for you to upload the .bat file here so we could see what it is trying to do?
My System SpecsSystem Spec
10 Jun 2014   #15

Windows 7 Ultimate 64bit

Sorry to not listen to your advise(s). But, thanks it work! Thank to everyone who is try to 'fix' my problem!
My System SpecsSystem Spec
10 Jun 2014   #16

Windows 7 Ultimate 64bit

But this is strange, because before I reinstall my Windows, I don't need the pause command
My System SpecsSystem Spec
10 Jun 2014   #17

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM

Glad to hear you got it fixed.

The pause command does nothing to fix any problems in the BAT file.

All it does is prevent the CMD window from closing so you can see what the BAT file did, and if there are any errors you can see the error message(s) and make changes to fix them.

If you have errors in a BAT file you can post them here like I did in post #12 and someone should be able to help you.
My System SpecsSystem Spec

 Can't open .bat file

Thread Tools

Similar help and support threads
Thread Forum
Open File - Security Warning : Allow or Prevent to Unblock File
Allow or Prevent to Unblock a File to Stop the "Open File - Security Warning" Prompt This will show you how to allow or prevent all users from being able to stop the Open File - Security Warning prompt by removing the unblock button and Always ask before opening this file check box for a...
File Open or Choose File dialog hangs application after selection made
Hi. Windows 7 Pro SP1 64 bit Intel i5 CPU @2.67 GHz 8 GB RAM This problem just started recently or I only noticed it in the past week or so. When I'm in any application that launches the File Open dialog, including any browser's "Select File/Browse" button to choose a local file, when I...
General Discussion
when open a word file or pwrpnt file another file is opens
God bless you, I am not a computer person please help me to fix the problem I have. Every time I open a word, power point and note pad program another file is opens with that (with a infinity sign in the front with the same extension ) is that a thread or how can I stop this thank you...
Microsoft Office
Open File Security Warning when file is on different local hard drive
Hello and this is my First Post Can you help me with an annoying dialog that pops up when running shortcuts please? I have (portable) applications located on E: I can run those applications directly from E: without a problem - i.e. I don't get any warnings. However if I create a...
System Security
Open Excel file to directly open from IE9
Hello guys, I wanted to open an excel file directly from IE9, but when I double click the excel file in the browser, it opens right in IE instead of Excel program. How do I make the file use Excel program to open rather than open in IE itself? I am using Windows 7 and Office 2010. I tried the...
Microsoft Office

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 16:31.
Twitter Facebook Google+