Windows shell programming
Jump to navigation
Jump to search
Configuring the Shell
- To enable copy & paste in the cmd shell: Click on the upper left corner of the window to pop up a menu. Choose Properties. Under the Options tab, make sure "Quick Edit" is selected.
- To copy some text, select it with the mouse and right click.
- To paste into the cmd shell, just right click.
Using MS-DOS
help -gives a list of commands help <command> -explains how to use <command> dir /? -explains how to use dir dir /x -lists files in 8-char format dir /p -lists dir by screenful (page)
To send an instant message to someone on a LAN:
net send <username> <message>
To write a batch script, save commands to a file with a ".cmd" suffix. To execute, type the file name at the command line.
To get command line help search for "command shell overview" in Windows help (F1 from the desktop).
To print out the names of all subdirectories of the current directory:
for /D %d in (*) do echo %d
To print out the names of all fna files in all subdirectories of the current directory:
echo off for /D %%d in (*) do ( cd %%d for %%f in (*.fna) do echo %%d\%%f cd .. ) echo on