Deinocheirus: Windows Console

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

  1. Start command prompt in administrator mode:
  2. Win+R > cmd > Ctrl + Shift + Enter

  3. Set PATH environment variable
  4. set PATH=%PATH%;"path/to/bin"
  5. Start Task Manager
  6. taskmgr.exe
  7. View Windows system log
  8. eventvwr
  9. Remove matched directories
  10. for /d %f in (Test_*) do rd %f /q
  11. Print current user
  12. whoami
    echo %username%
  13. Change user password in administrator mode
  14. net [user] [password]
  15. List all services
  16. set
  17. File and directory operations
  18. mkdir temp
    notepad foo
    rename foo bar
    ren bar foo
    copy foo bar
    move bar bar2
    del bar2
    cd ..\
    del temp
  19. Run vbscript from .bat
  20. 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

  • assign
  • attrib
  • backup
  • break
  • cd
  • change directory

  • cd..
  • change to parent directory

  • chdir
  • chkdsk
  • cls
  • clean screen

  • cmd
  • start a command prompt

  • color
  • command
  • comp
  • copy
  • ctty
  • date
  • defrag
  • del
  • deltree
  • dir
  • list contents of a directory

  • diskcomp
  • diskcopy
  • doskey
  • echo
  • edit
  • edlin
  • emm386
  • erase
  • exe2bin
  • exit
  • expand
  • fastopen
  • fc
  • fdisk
  • find
  • for
  • format
  • goto
  • graftabl
  • help
  • hexdump
  • hostname
  • if
  • if not
  • ipconfig
  • join
  • keyb
  • label
  • md
  • mem
  • mode
  • more
  • nomefile
  • path
  • pause
  • print
  • prompt
  • rd
  • recover
  • rem
  • ren
  • rename a file or directory

  • replace
  • restore
  • rmdir
  • remove directory

  • select
  • set
  • set environment variables

  • share
  • shift
  • sort
  • subst
  • sys
  • time
  • tree
  • type
  • undelete
  • unformat
  • ver
  • verify
  • vol
  • xcopy
  • [comando]/?

No comments:

Post a Comment

Myriad

Visitors