Type cd ~
Result ~ is your home directory.
||gets a list of all files and directories in current directory. Type: dir
ResultMicrosoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Users\Ted>dir
Volume in drive C has no label.
Volume Serial Number is xxxx-xxxx Directory of C:\Users\Ted 03/19/2008 07:47 PM <DIR> .
03/19/2008 07:47 PM <DIR> ..
01/28/2008 07:06 PM <DIR> Contacts
05/27/2008 05:16 PM <DIR> Desktop
05/07/2008 06:59 AM <DIR> Documents
05/07/2008 06:51 AM <DIR> Downloads
03/19/2008 07:47 PM 575,342 ElfPDFStream.pdf
04/15/2008 06:34 PM <DIR> Favorites
01/28/2008 07:06 PM <DIR> Links
05/09/2008 07:01 PM <DIR> Music
02/29/2008 04:42 PM <DIR> Pictures
01/30/2008 07:33 PM <DIR> Saved Games
01/28/2008 07:06 PM <DIR> Searches
01/28/2008 07:06 PM <DIR> Videos
2 File(s) 580,944 bytes
13 Dir(s) 138,648,293,376 bytes free
||| Pipe or redirect output to another command. This allows you to chain multiple commands together without having to create files at each immediate step. > Pipe or redirect output to a physical file. Type: dir > test.out
Results: Now you have created a text file is the deletes of the file located
||Make a directory. Type: mkdir test
Results: type ls and see your directory listed.
||Moves or renames a file. This is useful to rename output files when debugging a process.
Type: rename test.out list.out
Results: now the file test.out has been renamed to list.out.
||Copy a file or directory (with -r option).
Type cp list.out test.out
Results Now you have two file list.out and test.out
||Removes a directory
||Remove a file .
Type rm list.out
Results the list.out file has been deleted.
||Allows read-only access to a file. To quit out of MORE type :q.
Type: more test.out
Result: The output should look the same as if you ran the ls –l command.
||Edit is a command line text editor for DOS that is similar to VI.
||To make text appear in the command window use the echo command. This can be useful to alert users to how a script or program is running.
||The change the permissions or mode of a file use attrib. Type attrib +r test.out
Clears command window of all text so far written back from the bat script
||Use REM to put comments into the script
||List the top 10 processes on the machine. Important to tell whether you are playing nice with others.
|Use to set environmental variables.
Set path =
|Run another bat from script without stopping .
||Halts the execution of the code till user input. Useful to see error messages and output of the code.
|Example Environmental Variables below.
%winDir%. Path to the windows directory.
%userprofile% Path to user s directory
%OS% The OS