home Tech Batch Files In Windows 7

Batch Files In Windows 7

In case you have made a batch file in Windows 7,you might have noticed that it doesn’t really work as it should right off the bat.

Here is what I am saying :

Suppose a simple batch file that pings a website continuously is made (ping.bat) in this case :

(If you want to learn how to make batch files in Windows to do stuff,refer to my old post here.)

 

batch00

Notice that once it is saved as .bat extension and made to run,it gives some funky output like this :

batch0

It simply shows the command as it is without actually executing and the reason it does this is because the access to Windows command processor isn’t given by default.

The fix – just right click the batch file and set it to Run as administrator.

It will bring up a dialog box that asks whether Windows command processor should be allowed to run (select Yes there).

batch2

Once done,the batch file will work as we want it to (in this case pinging a web site continuously) :

batch1

Try making batch files for various stuff(checking ipconfig etc) and none of that will actually work as expected by default unless the Administrator mode is set in Windows 7.

Cheers.

Leave a Reply

Your email address will not be published. Required fields are marked *