Question Locked

How to create a batch file

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do i create a batch file and how to execute them?

5 replies

by churdoo

Open Notepad and type your batch file. Then File / Save As. In the Save As dialogue box, Navigate to where you want to place the batch file (suggest creating a folder c:\batch or similar) / give it a file name with .BAT on the end (i.e. mybatch.bat) / be sure to change the "Save as type" to All Files / then click Save. Once the file is created, editing is easier, simply navigate to the file with Explorer, right-click the file's icon, and click Edit.

To execute, simply navigate to the file with Explorer and double-click the file's icon.

For testing however, this will not show you if you have any errors in your batch file. so for testing, open up a CMD prompt. Start / Run / type CMD / click OK. Change directory to where you saved the .BAT file; for example, enter "CD \BATCH". Once your CMD prompt is in the directory where the .BAT file is stored, simply enter the name of the file to execute it.

Once you've tested the batch file, you can schedule it as a Scheduled Task if it's something that needs to be run regularly at specific times.

This discussion is closed to new replies.