Windows Commands TechForWorld
Windows Commands TechForWorld
Windows Commands TechForWorld
Tricks
By Jignesh Rathod
W hat is the easiest and fastest way to run or open something in Windows? Of course
using the Run command. If you know Windows Run Commands for things you use
frequently, you don‟t have to navigate through menus and search for it: Imagine how much
time it it would save you! Using Run commands is the fastest way to open programs, files,
folders and websites too.
Calculator calc
Display dpiscaling
Findfast findfast.cpl
HyperTerminal hypertrm
Magnifier magnify
Narrator narrator
Netmeeting conf
Notepad notepad
System File Checker Utility (Scan Once At The Next Boot) sfc /scanonce
System File Checker Utility (Sets Cache Size to size x) sfc /cachesize=x
Wordpad write
Shell Commands
Shell commands provide access to Windows special folders. You can find list and settings
for all Shell folders in Windows Registry at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\Fo
lderDescriptions (In Windows XP,
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders).
Internet Explorer
Cookies shell:Cookies
Cookies\Low shell:Cookies\Low
Favorites shell:Favorites
Library
Libraries shell:Libraries
Libraries shell:UsersLibrariesFolder
Multimedia
System
Computer shell:MyComputerFolder
Fonts shell:Fonts
GameExplorer shell:PublicGameTasks
Games shell:Games
Homegroup Shell:HomeGroupFolder
Network shell:NetworkPlacesFolder
Printers shell:PrintersFolder
Resources shell:ResourceDir
SysWOW64 shell:SystemX86
User
Contacts shell:Contacts
Desktop shell:desktop
Documents shell:Personal
Downloads shell:downloads
Links shell:Links
Protect shell:dpapiKeys
Ringtones shell:Ringtones
Searches shell:Searches
SystemCertificates shell:SystemCertificates
Templates shell:Templates
Windows Sync
Note:
Commands in Magenta color work only in Command Prompt.
Most Useful Windows Commands You Must Know
By Jignesh Rathod, TechForWorld
Tips
1. Previously Used Commands:
Press up and down arrow keys to cycle through previously used commands. You can also
edit the command any time using left and right arrow keys.
2. Abort a Comnand:
Use Control+C to abort any command any time.
3. Copy Text from Command Window:
You can copy text from command window. Right click on Command Prompt window and
select ‟Mark‟. Now select text using your mouse, and you can paste it to any program.
4. Auto-complete File Names:
Use Tab key to automatically show file or folder name in the current directory. For example,
type CD C:\Windows\ and keep pressing tab key to see names of all directories and files
within that folder.
5. Paste Text in Command Prompt:
Right click on the Command Prompt window and select „Paste‟ to copy text or command
from clipboard.
You can also drag and drop any file or folder inside the Command Prompt window to
quickly copy it‟s path.
6. Open cmd Directly in a Directory:
Press Shift key and right click on any folder and you can use „open command window here„ to
directly open the Command Prompt within that directory.
7. Select Command from History:
Press F7 key to see a list of previously executed commands and select from them.
DATE /T | CLIP
COLOR 8A (Change background color to gray (8) and text color to light green (A))
COMP ―file1.txt‖ ―file2.txt‖ /N=50 (Compare first 50 lines. Use this if both file sizes are different)
DEL /F * (Delete all files including any that are read only)
TYPE nul > file.txt (Use this command before DEL to clear all contents before deleting the file for safety
purpose, since third-party utilities can undelete your files)
Tip: If the file or folder name contains a space, you must use it within inverted commas, like
“D:\My Pictures”
IPCONFIG – Configure IP
IPCONFIG /FLUSHDNS (Purge the DNS Resolver cache)
MSG JIGNESH (If no message text to send is specified, MSG will prompt for it)
/E (Include subfolders)
/COPYALL (Copy all file info like attributes, timestamps, security info, owner info)
SCHTASKS /Create /SC weekly /D MON,TUE,WED,THU,FRI /TN MyDailyBackup /ST 23:00 /TR
c:\backup.cmd /RU MyDomain\MyLogin /RP MyPassword (Create a task to run at 11 pm every weekday)
SCHTASKS /create /TN ―My Script‖ /TR ―\‖c:\my folder\script.cmd\‖ arguments‖ /sc daily /sd 12/29/2014 /st
17:00 (Create a daily task to run a script at 5 pm)
Please note that task scheduler options are stored in Windows Registry at
HKLM\SOFTWARE\Microsoft\SchedulingAgent\
/SCANONCE (Scan all system files once you restart the computer. The SfcScan DWORD value is set to 2 in
the following registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon)
/SCANBOOT (Scan all protected system files every time you start your computer. The SfcScan DWORD
value is set to 1 in the following registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon)
/S (Shutdown)
/A (Abort shutdown)
TIME /T (Only output the current time without asking new time)
TIMEOUT – Wait for specified seconds or until any key is pressed. For use within a
batch program.
TITLE – Set the window title for a CMD.EXE session
TRACERT – Trace route (find IP address) to a remote host
TRACERT TechForWorld.com
By default the Command Prompt has verify OFF. Windows Explorer will always copy with verify ON.
VOL – Display the disk volume label and its serial number
WAITFOR – Wait for or send a signal
WEVTUTIL – Clear event logs, enable/disable/query logs
WHERE – Search for files in a directory tree
WHERE /R D:\ Tech (Find all files named tech in drive D: and all sub-folders)
Please note that in many cases the functionality of XCOPY is superseded by ROBOCOPY.