You are here : Miscellaneous > Batch files | DinkostaOnline |
|
Batch files are Textdocuments, which contain a series of commands and execute them, one after another. A batch file can be activated if you doubleclick on it or if you type the name of the batch file into the Command prompt. The purpose of such files is to automate certain repetitive actions and to enable you to work faster and with more comfort. Here is an example of a small batch file that enables you to restart your PC with a doubleclick on this batch on the desktop (without going to Start>Shut Down...>Restart) : rundll32.exe shell32.dll,SHExitWindowsEx 2 In order to make of this a batch file, open Notepad, type the code from above (pay attention to the two spaces), save it as "restart.bat" (the name doesn't matter, but the extension ".bat" is important) and choose "All files". Similar to this, you can make a Shutdown batch, which can be used with the Task Scheduler to automatically shut down the PC on a predefined time (included in Batch.zip). See below for other rundll commands. |
If you don't want to see the DOS window during the execution of a Batch file right-click on the Batch file, select 'Properties' and then choose the Program tab, select in the Run: field Minimized and below that check Close on exit. To edit or just to view the source of a Batch file right-clik on its icon and select Edit (if you double-click the icon or press ENTER the Batch file will be executed). Here are some more examples of simple batch files: type into Notepad REGEDIT and save this with an .bat extension (for example, regedit.bat). With a double-click on this file you can now open the Registry Editor. SNDREC32 would open the Sound Recorder, SNDVOL32 the volume control applet etc. • If you want to know more about Batch files order by email Batch.zip (50 KB, explanations in text format, 5 Euro/US$), where you can find more than 30 ready-made Batch files: deleting cookies, starting several programs simultaneously, prolong shareware test-period, instant hiding of folders and files, automating backups etc. Rundll Commands
|