How to Write a Batch File:
OS used : Windows
Writing a batch file is used to automate daily and often mundane tasks. Instead of typing the same commands day after day, you would simply double click the batch file to run said commands. These instructions will show you how to do so.
For Windows
1.
Open up Notepad in Windows. You can do this by navigating to Start > Programs > Accessories > Notepad, or simply by entering notepad under Start > Run.
2.
Or open up notepad by keying C:\WINDOWS\system32\notepad.exe
3.
Save your file before anything, so be sure to follow the instructions closely.
1. Go to File > Save As... and chose a file name.
2. Choose your desktop as the location to save.
3. Click on the dropdown box "Save as type:" and select "All files" instead of Text (*.txt).
4. Add .bat to the end of your file name before you save. For example, you would type wikihow.bat.
5. Click on Save. If you did this correctly, you should see your file name in the title bar of Windows Notepad. Make sure that it reads as wikihow.bat—not wikihow.bat.txt. Now you are ready to create your batch file.
4.
Type "@echo off" on the first line of your batch file. This will prevent any commands in the batch file to be sent to the screen when executed.
5.
Enter your commands. The following examples show you how to create a batch file that will automatically load wikiHow.com using Internet Explorer.
1.
First example:
1.
o @echo off.
o REM The following will open wikiHow.com in a new Internet Explorer window.
o start iexplore.exe www.sivab.org
or, second example:
1.
o @echo off.
o REM The following will open wikiHow.com in your default browser, if it is IE and you have another IE window open, then it will hijack that window or open a new tab.
o start www.sivab.org
2.
Save the file.
3.
Run the file by double clicking the file on your desktop.
Ex1:
Save the following as “siva.bat” and double click the file.
@echo off
start iexplore.exe www.wikihow.com
Ex2:
Save the following as “siva.bat” and double click the file.
@echo off
start www.wikihow.com
Thanks to :
http://www.wikihow.com/Write-a-Batch-File
No comments:
Post a Comment