- Open up Notepad in Windows. You can do this by navigating to Start > Programs > Accessories > Notepad, or simply by entering notepad under Start > Run.
- Or open up notepad by C:\WINDOWS\system32\notepad.exe
- Save your file before anything, so be sure to follow the instructions closely.
- Go to File > Save As... and chose a file name.
- Choose your desktop as the location to save, for now. Don't click Save just yet.
- Click on the dropdown menu next to "File name". Select "All files" instead of Text Document".
- Add .bat to the end of your file name before you save. For example, you would type example.bat.
- Click on Save. If you did this correctly, you should see your file name in the title of Windows Notepad. Make sure that it reads as example.bat—not example.bat.txt. Now you are ready to create your batch file.
- Type "@echo off" on the first line of your batch file. This will prevent any spaces in the batch file to be read by the program when executed.
- Enter your commands. The following example below will show you how to create a batch file that will automatically load wikiHow.com using Internet Explorer.
- @echo off.
- REM The following will open wikiHow.com in a new Internet Explorer window.
- "start Iexplore.exe www.wikihow.com"
- REM The following will open wikiHow.com in your default browser, but if it is IE and you have another IE window open, then it will hijack that window.
- "start www.wikihow.com"
- Save the file by going to "File>Save" and type in "wikihow.bat".
- Run the file by double clicking the file on your desktop.
Friday, September 25, 2009
How to Write a Batch File For Windows
Labels:
.bat,
.dll,
batch file,
DOS,
installation. corrupted,
notepad,
system32
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment