You can write Windows scripts using batchfile that are DOS / CMD lines for windows. For more advance features, the best is still to use PowerShell.
To start a .exe
file you can either use start
to start it or use use its name.exe
to install it.
Get help on the start command:
start /?
When plugin something from a computer, you can have default action. One of them is reading the autorun.inf
file which have instruction to start softawre (DVD -> launching the movie, CD -> launching the software or music, and all). Be careful some malicious softwares can be run too.
Inside your autorun.int
:
[autorun]
open = application_to_start.bat
For some of the necessary command:
F: # Go to drive F:
CD C:\folder # Like linux to go inside C:\folder
DIR # list what's inside the directory
REN *.xyz *.txt # Rename file
XCOPY *.txt C:\folder\ # Copy file from a folder to another
MOVE C:\folderA\* C:\folderB # Move content of folderA under folderB
A couple of trips:
- In windows, paths are made using
\
back slash. - To get help on a command use
\?
.