It also gives you a better understanding of how batch files are written and how they work....
.......Enjoy......
| @ | Does not echo back the text after the at symbol. This is most commonly used as @ECHO OFF to prevent any of the commands in the batch file from being displayed, just the information needed. |
| %1 | The percent followed by a numeric value, beginning with one, allows users to add variables within a batch file. The below line is an example of what can be used in a batch file. ECHO Hello %1 When the above one-line batch file is created, add your name after the batch file. For example, typing myname (being the name of the bat file) and then your name: myname bob would output: Hello bob Note: This can be extended to %2, %3, and so on. |
| :: | One of two ways of adding remarks into the batch file without displaying or executing that line when the batch file is run. |
dir "C:\Program Files" > C:\list_of_program_files.txt(I'm assuming that your Program Files folder is on the C: drive). This will give us the two-line file @echo offdir "C:\Program Files" > C:\list_of_program_files.txt Now save this two-line file as "listprograms.bat" (without quotes) to some convenient location. Be sure that Notepad is saving as "All files" and not as a text file @echo off