USERS AND GROUPS

net user
net user newuser /add
net user newuser password /add
net localgroup users newuser /add
net user newuser
net user newuser newpassword
net user newuser *
net user newuser * /domain
wmic useraccount where name='newuser' set PasswordRequired=false
wmic useraccount where name='newuser' set PasswordExpires=false
net view
net localgroup
net localgroup administrators
net localgroup newgroupname /add
net localgroup newgroupname /del
net group "group name" "user name" /add /domain

FILES AND FOLDERS

rmdir "folder with spaces in the name"
rmdir /Q /S nonemptydir
rd /S "nonempydir"
takeown /F "folder to get control" /R /A

GENERAL CMD

query session
logoff 1
wmic os get OSArchitecture
echo %PROCESSOR_ARCHITECTURE%
systeminfo
systeminfo | findstr /C:"Install Date"
tasklist
net share
net share "shared folder" /delete
for %i in (C$ IPC$ ADMIN$) do net share %i /delete
type myfile.txt
fc file1.txt file2.txt
netsh wlan show profile SmithHouse key=clear
type fileName.txt

GENERAL POWERSHELL

tasklist
stop-process -id 1
stop-process -name chrome
get-service
get-service vboxservice
stop-service vboxservice
start-service vboxservice

VIRTUALBOX AUTOMATION SCRIPTS

Create the following scripts and add them in Local Group Policy Editor > Windows Settings > Scripts (Startup/Shutdown).

"%ProgramFiles%\Oracle\VirtualBox\VBoxManage.exe" startvm "Ubuntu" --type headless
set VBoxManageEXE="%ProgramFiles%\Oracle\VirtualBox\VBoxManage.exe"
set ListRunningVMS=%VboxManageEXE% list runningvms
for /f tokens^=2^,4^ delims^=^" %%p in ('%ListRunningVMS%') do %VBoxManageEXE% controlvm %%p savestate

SIMPLE COMMANDS

  • hostname
  • whoami
  • ipconfig
  • netstat
  • netstat -a
  • netstat -b
  • netstat -e

CALLING COMMON APPLICATIONS

  • lusrmgr.msc
  • control.exe
  • UserAccountControlSettings.exe
  • compmgmt.msc
  • msinfo32.exe
  • resmon.exe
  • wf.msc

BONUS

  • Windows\System32\config
    • The location where Windows stores credentials.