Intro to CMD


Intro to CMD


-Open CMD as Admin by holding down CTRL + Shift double click
-Open PowerShell as Admin by holding down CTRL + Shift double click
-Open a program as Another User by holding down Shift + Right Click


After open up CMD right click on the Top of the program > Property to change Fonts and Color. 
————-
RUN > CMD > help 


cd..      go back 1 level to pervious folder
—-

Dir         show folder contents
Dir /P    show folder content one screen at a time

—–
cd        change folder
cd    E:\Windows\

REN    rename that folder after you did a CD to it above
ren   E:\Windows\WinSxS\      winSxS-original

MD     make new folder within that path CD above
md   
E:\Windows\WinSxS

xcopy      *copy everything within F: WinSxS folder to e:
xcopy /h /s   F:\Windows\WinSxS\*         e:\Windows\WinSxS\
—–

copy      copy a single file install.esd to E:
copy   F:\windowserver2019\sources\install.esd   E:\
——

Takeown        Take ownership of a folder and files
Takeown  /f   e:\windows\WinSxS   /a /r /d   y

—–

DEL   delete a folder within that path that you are in
cd c:\Windows\myBackup\
Del    myBackup

—–
Start 
  open up a program
Start    notepad

Open two program at once 
Start    notepad   &&   Start CMD

In PowerShell you will   ;
—————


How to take Ownership of a Folder:
takeown /f “f:\Windowsll” /R && icacls “f:\Windowsll” /grant administrators:F /c /l

rmdir /S f:\Windowsll


xcopy /h /s /e    %name3%%name4%* %name3%%name5%\


Runas /user:%userdomain%\administrator /savecred “cmd.exe /k ipconfig /all && echo. && echo. && echo. && netstat -rn && echo. && echo. && echo. && arp -a”

Runas /user:%userdomain%\administrator /savecred “cmd.exe /k ping -n 10 “%name%” && tracert “%name%” && netstat -an && ping google.com && netstat -rn ”

TIME OUT WITH CMD in 5 second and also close out CMD:
Runas /user:%userdomain%\administrator /savecred “cmd /k cd c:\Windows\system32\drivers\etc\ && notepad hosts && timeout /t 5 && exit ”


Declare variable and store:
SET   “HotFix=”
  @ECHO OFF
set   /p    HotFix= Please Enter the Window Update HOTFIX like KB:4486153 :

Start Wireshark.exe -r “C:\myFile\lognreport\pktmon-packetCapture.et1”



:::::::::CMD Color:::::::::::::

@echo off
::Comment
::0 is background Black color
::text color A, B, E is best
::This is A GREEN, B blue, E Yellow
::This is GREEN
color 0E
::0 = Black 8 = Gray
::1 = Blue 9 = Light Blue
::2 = Green A = Light Green
::3 = Aqua B = Light Aqua
::4 = Red C = Light Red
::5 = Purple D = Light Purple
::6 = Yellow E = Light Yellow
::7 = White F = Bright White

::::::::::::::End Color::::::::::::::

…The End…


Published by

Khmer Certified

Welcome to Khmer Certified. We're all about sharing the experienced in Information Technology. Our site is not an introduction to computer. We are more about sharing your journey that may take to get a job in an entry level IT - your first year in IT field

Leave a comment