Note: Here I unifily call "cmd.exe", "Windows Command line", "Command Prompt" "Terminal" as "Console", just to clear our sight.
Notes
The Windows Console cmd.exe, aka. command prompt is the interpreter of commands. It is case-insensitive, i.e. typing taskmgr and TaSkMgr has the same effect. Also taskmgr and taskmgr.exe are the same command.
Q&A List
- Start command prompt in administrator mode:
- Set PATH environment variable
- Start Task Manager
- View Windows system log
- Remove matched directories
- Print current user
- Change user password in administrator mode
- List all services
- File and directory operations
- Run vbscript from .bat
Win+R > cmd > Ctrl + Shift + Enter
set PATH=%PATH%;"path/to/bin"
taskmgr.exe
eventvwr
for /d %f in (Test_*) do rd %f /q
whoami echo %username%
net [user] [password]
set
mkdir temp notepad foo rename foo bar ren bar foo copy foo bar move bar bar2 del bar2 cd ..\ del temp
Prepare your .bat file like the following. ~%dp0 will expand to the path to your .bat file. pushd is to save that path.
@echo off pushd %~dp0 cscript youvbsfile.vbs
System Programs
Generally, executable files under the %PATH% can be launched from console.
- control
- regedit
- services.msc
- mspaint
- notepad
List of Commands
assignattribbackupbreakcdcd..chdirchkdskclscmdcolorcommandcompcopycttydatedefragdeldeltreedirdiskcompdiskcopydoskeyechoeditedlinemm386eraseexe2binexitexpandfastopenfcfdiskfindforformatgotograftablhelphexdumphostnameifif notipconfigjoinkeyblabelmdmemmodemorenomefilepathpauseprintpromptrdrecoverremrenreplacerestorermdirselectsetshiftsortsubstsystimetreetypeundeleteunformatververifyvolxcopy[comando]/?
change directory
change to parent directory
clean screen
start a command prompt
list contents of a directory
rename a file or directory
remove directory
set environment variables

No comments:
Post a Comment