---------------CMD Shortcuts--------------- Home Key Cursor at line command start End Key Cursor at line command End Crtl+Left Arrow Cursor One step Backward Crtl+Right Arrow Cursor One step Forward Ctrl+Backspace Delete complete Word Backward Insert Key Replace the letters by adding new letters ---------------------CMD itself Commands--------------------- Color a Dark green Color b Light green Color c Light Red Color d Dark Red Color e Yellow cls clear screen quit exit back +++++++++++++ CMD HELP commands +++++++++++++ /?, -help Displays information about command-line parameters. help COMMAND COMMAND /? COMMAND SubCommand /? COMMAND SubCommand Attribute /? /list, /L Lists all power schemes. /query, /Q Displays the contents of a power scheme. /change, /X Modifies a setting value in the current power scheme. ---------------------------------system File/Folders management commands-------------------------------- driverquery cd change directory one step Forward cd.. change directory one step Backward cd / change directory to HOME press TAB to check files & folders one by one in current directory & hit Enter to open files md mkdir make new folder rmdir remove folder ren rename a folder tree directories in tree hierarchy Date Time doskey/history Commands history echo my name is adil > myanme.txt new file with some text tasklist > abc.txt copy con good.txt ENTER press Ctrl+Z > ENTER new file with some text type abc.txt to open file in cmd type nul> abc.doc to create an empty file move abc.txt DEST_FOLDER winrm help config winrm get winrm/config winrm get winrm/config/client winrm get winrm/config/service winrm enumerate winrm/config/resource winrm enumerate winrm/config/listener winrm enumerate winrm/config/plugin winrm enumerate winrm/config/service/certmapping winver to check windows version ----------- Bitlocker Commands ----------- Status manage-bde -status Turn off Bitlocker manage-bde -off C: Re-enable BitLocker protection: manage-bde -protectors -add C: -tpm manage-bde -protectors -enable C: manage-bde -protectors -list C: ******************* system hardware commands ******************* DevicePairingWizard.exe add Hardware wizard diskpart>detail disk chkdsk to check disk issues if available, run as admin ++++++++++++++++++ BIOS Properties ++++++++++++++++++ wmic bios get serialnumber PC Serial Number BiosCharacteristics BuildNumber CodeSet CurrentLanguage Description IdentificationCode InstallDate InstallableLanguages LanguageEdition ListOfLanguages Manufacturer Name OtherTargetOS PrimaryBIOS ReleaseDate SMBIOSBIOSVersion SMBIOSMajorVersion SMBIOSMinorVersion SMBIOSPresent SerialNumber SoftwareElementID SoftwareElementState Status TargetOperatingSystem Version ++++++++++++++++++ CPU Properties ++++++++++++++++++ systeminfo detailed sysem info wmic > cpu CPU name wmic cpu get name detailed CPU info wmic computersystem get totalphysicalmemory to check total RAM capacity installed wmic computersystem get type BELOW COMMANDS set to check system propeerties like CPU type and architecture/generation eg.: LOGONSERVER=\\ADILLAPTOP-11 NUMBER_OF_PROCESSORS=4 OS=Windows_NT PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 78 Stepping 3, GenuineIntel PROCESSOR_LEVEL=6 = Generation of processor may be PROCESSOR_REVISION=4e03 ++++++++++++++++++ System Properties ++++++++++++++++++ e.g, wmic computersystem get totalphysicalmemory AdminPasswordStatus Name LastLoadInfo AutomaticResetBootOption NameFormat Manufacturer AutomaticResetCapability NetworkServerModeEnabled Model BootOptionOnLimit NumberOfProcessors WakeUpType BootOptionOnWatchDog OEMStringArray Workgroup BootROMSupported PartOfDomain UserName BootupState PauseAfterReset SystemStartupOptions Caption PowerManagementCapabilities SystemStartupSetting ChassisBootupState PowerManagementSupported SystemType CreationClassName PowerOnPasswordStatus ThermalState CurrentTimeZone PowerState TotalPhysicalMemory DaylightInEffect PowerSupplyState SupportContactDescription Description PrimaryOwnerContact SystemStartupDelay Domain PrimaryOwnerName InstallDate DomainRole ResetCapability KeyboardPasswordStatus EnableDaylightSavingsTime ResetCount ResetLimit FrontPanelResetStatus Roles InitialLoadInfo InfraredSupported Status ++++++++++++++++++ RAM Properties ++++++++++++++++++ ------------------- individual Properties ------------------- wmic memorychip get speed wmic memorychip get capacity to check individual RAM capacity wmic memorychip get devicelocator, partnumber wmic memorychip get smbiosmemorytype Supported memory types 0: Unknown 9: RAM 18: SGRAM 1: Other 10: ROM 19: RDRAM 2: DRAM 11: Flash 20: DDR 3: Synchronous DRAM 12: EEPROM 21: DDR2 4: Cache DRAM 13: FEPROM 22: DDR2 FB-DIMM 5: EDO 14: EPROM 24: DDR3 6: EDRAM 15: CDRAM 25: FBD2 7: VRAM 16: 3DRAM 26: DRR4 8: SRAM 17: SDRAM 28/34: DDR5 wmic memorychip get devicelocator, formfactor FORM FACTORS 0: Unknown 9: TSOP 17: TQFP 1: Other 10: PGA 18: SOIC 2: SIP 11: RIMM 19: LCC 3: DIP 12: SODIMM 20: PLCC 4: ZIP 13: SRIMM 21: BGA 5: SOJ 14: SMD 22: FPBGA 6: Proprietary 15: SSMP 23: LGA 7: SIMM 16: QFP 24: FB-DIMM ------------------- RAM All Properties ------------------- wmic computersystem get totalphysicalmemory to check total RAM capacity installed wmic memorychip get wmic memorychip list wmic memorychip get devicelocator, manufacturer, memorytype, smbiosmemorytype, speed, banklabel, partnumber, serialnumber, capacity, formfactor wmic memorychip list full to LIST all properties of installed RAMs ++++++++++++++++++ BIOS Properties ++++++++++++++++++ wmic bios get smbiosbiosversion bios version tpmtool getdeviceinformation TPM trusted platfrom module info get-tpm win+R type mdsched ENTER to check RAM issues, need restart *********************** system power commands *********************** shutdown /i Displays the Remote Shutdown box /a ABORTS a system shutdown. Can only be used during the time-out period. Combine with /fw to clear any pending boots to firmware. shutdown/l Logs off the current user immediately, with no time-out period. You can't use /l with /m or /t. /s Shuts down the computer. /r Restarts the computer after shutdown. /o Goes to the Advanced boot options menu and restarts the device. This option must be used with the /r option. /h Puts the local computer into hibernation, if hibernation is enabled. The /f switch can be used with the /h switch. /f Forces running applications to close without warning users. Caution: Using the /f option might result in loss of unsaved data. /soft Allows running processes and applications to gracefully close instead of forcibly terminating. /fw Combining this option with a shutdown option causes the next restart to go to the firmware user interface./e Enables you to document the reason for an unexpected shutdown of a computer in the Shutdown Event Tracker. /t Sets time-out period before shutdown to xxx seconds. range is 0-315360000 , default of 30. If timeout greater than 0, the /f implied. SHUTDOWN -r -t 10 powercfg /batteryreport powercfg /energy system energy utilization report powercfg /sleepstudy syatem operation report >powercfg /srumutil *********************** system Users commands *********************** tasklist taskkill /pid net user net user nespk /del net user abcd /add net user administrator /active:yes net user administrator /active:no net user "administrator" * ENTER > password password change gpresults /r gpupdate /force attrib +h +r +s to hide files in a directory atrrib -h -r -s to unhide files cipher /d to decrypt files cipher /e to encrypt files *********************** Network commands *********************** hostname find hostname of system ping [IP or FQDN] Ping IPv4 ping ::1 ping IPv6 ping localhost -4 Force using IPv4. ping localhost -6 Force using IPv6. ping loopback -4 Force using IPv4. ping loopback -6 Force using IPv6. ping fe80::3:2%9 ping IPv6 with scope ID (%xx) ping -t IP continuos ping ping -a IP Resolve addresses to hostnames. ping -l Send buffer size in bytes ping -n Number of echo requests to send ping /w Specifies the amount of time, in milliseconds, The default time-out is 4000 (4 seconds). ping Dest-IP -S Src-IP use capital S with - to ping destination IP with Source NIC IP C:\Users>curl ipinfo.io/ip To check Public IPv4 address C:\Users>curl ifconfig.me/ip To check Public IPv6 address ipconfig To check Private IPv4 address ipconfig/all ipconfig/release To release IP configs on all interfaces ipconfig/renew ipconfig /release "Wi-Fi" To release IP configs on specific NIC ipconfig /renew "Ethernet" To renew IP configs on specific NIC ipconfig /release "Ethernet" & ipconfig /renew "Ethernet" Static IP Configs: ------------------- netsh interface ip set address name="Ethernet" static 192.168.1.10 255.255.255.0 192.168.1.1 netsh interface ip set dns name="Ethernet" static 8.8.8.8 netsh interface ip add dns name="Ethernet" 8.8.4.4 index=2 netsh interface ip set address name="Ethernet" source=dhcp Enable DHCP for IP on an interface netsh interface ip set dns name="Ethernet" source=dhcp Enable DHCP for DNS on an interface --------------- DNS Commands --------------- ipconfig /displaydns ipconfig /flushdns nslookup [IP or Domain name] ipconfig /displaydns ipconfig /displaydns > dns-cache.txt ipconfig /displaydns > %USERPROFILE%\Desktop\dns-cache.txt ipconfig /flushdns ipconfig /registerdns ipconfig /all nslookup google.com nslookup google.com 8.8.8.8 nslookup 8.8.8.8 ping google.com Get-DnsClientCache Get-DnsClientCache | Out-File "$env:USERPROFILE\Desktop\dns-cache.txt" Clear-DnsClientCache Get-DnsClientServerAddress Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses ("8.8.8.8","1.1.1.1") Resolve-DnsName google.com Test-NetConnection google.com -Port 53 ------------------------------------------- tracert [IP or FQDN] tracert -6 [IP or FQDN] tracert -d -d Do not resolve addresses to hostnames. -h maximum_hops Maximum number of hops to search for target. -j host-list Loose source route along host-list (IPv4-only). -w timeout Wait timeout milliseconds for each reply. -R Trace round-trip path (IPv6-only). -S srcaddr Source address to use (IPv6-only). -4 Force using IPv4. -6 Force using IPv6. +++++++++++++++++ TFTP +++++++++++++++++ tftp Syntax: TFTP [-i] host [GET | PUT] source [destination] tftp -i Host1 get boot.img copy the file boot.img from the remote computer Host1 -i Specifies binary image transfer mode (also called octet). In binary image mode the file is moved literally, byte by byte. Use this mode when transferring binary files. host Specifies the local or remote host. GET Transfers the file destination on the remote host to the file source on the local host. PUT Transfers the file source on the local host to the file destination on the remote host. source Specifies the file to transfer. destination Specifies where to transfer the file. +++++++++++++++++ Telnet/SSH +++++++++++++++++ telnet [IP] telnet [IP]/port [PORT#] ssh -l USERNAME IP ++++++++++++++++++ wireless commands ++++++++++++++++++ netsh wlan show all netsh wlan show profile netsh wlan show Profiles FiberNetAdil key-clear netsh wlan set Hostednetwork mode=allow ssid=nespk key=nespk@123 netsh wlan start hostednetwork ++++++++++++++++++ Routing Commands ++++++++++++++++++ all added routes might be DELETED on restart or shutdown, meaning that they are TEMPORARY for ROUTES to be added PERMANENTLY, add a PERSISYENT route with "route add -p" command COMMAND 1: route add 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2 destination^ ^mask ^gateway metric^ ^ Interface (local interface net ip)^ 0.0.0.0(any net) 0.0.0.0(any mask) 192.168.8.1 35 192.168.8.177 OR if above COMMAND 1 is not applicable try following COMMAND 2 for simplicity: COMMAND 2: route add DEST_NET_ADDRESS mask DEST_NETMASK GATEWAY_TO_DEST_NET If IF is not given, it tries to find the best interface for a given gateway. route /p add 10.41.0.0 mask 255.255.0.0 10.27.0.1 add PERSISTENT route to destination 10.41.0.0, subnet mask of 255.255.0.0, next hop address 10.27.0.1, without -p routes deleted on restart route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7 add route to destination 10.41.0.0, subnet mask 255.255.0.0, next hop address 10.27.0.1, cost metric 7 route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3 add route to destination 10.41.0.0, subnet mask 255.255.0.0, next hop address 10.27.0.1, interface index 0x3 arp -a show interface index ID, MAC address etc route add 3ffe::/32 3ffe::1 add IPv6 route route change 10.41.0.0 mask 255.255.0.0 10.27.0.25 change next hop address of route with destination 10.41.0.0, subnet mask 255.255.0.0 from 10.27.0.1 to 10.27.0.25 route change 157.0.0.0 mask 255.0.0.0 157.55.80.5 metric 2 if 2 CHANGE is used to modify gateway and/or metric only. route delete 157.0.0.0 route delete 10.41.0.0 mask 255.255.0.0 delete route to destination 10.41.0.0, subnet mask 255.255.0.0 route delete 10.* delete all routes in the IP routing table that begin with 10 route delete 3ffe::/32 delete IPv6 route route print show routing table route print 192.* show routes start with 192. route print 192.168* show routes start with 192.168 netstat -r show routing table ++++++++++++++++++ MAC Address Commands ++++++++++++++++++ getmac getmac /s 192.168.8.176 Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. arp -a show interface index ID, MAC address etc arp -g similar to -a arp -s ip mac static entry to reslove ip to mac___run cmd as admin arp -d ip to delete mac against ip________________run cmd as admin ++++++++++++++++++ TCP/UDP Ports and connections Commands ++++++++++++++++++ netstat netstat -a Active TCP/UDP Connections netstat -an Like -a netstat -ano | findstr :80 To find that whcich program (PID) is using a specific port netstat -ab Active TCP/UDP Connections by applictaions netstat -e Bytes sent/received through an interface netstat -r show routing table netstat -s IPv4, IPv6, ICMPv4, ICMPv6 Statistics, TCP/UDP statistics for IPv4, IPv6 ++++++++++++++++++ COM Ports and connections Commands ++++++++++++++++++ mode To check available COM ports & their Configurations wmic path Win32_PnpEntity where "PNPClass='Ports'" get Caption,DeviceID,Manufacturer ++++++++++++++++++ NetBIOS name resolution Commands ++++++++++++++++++ nbtstat Displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP). nbtstat -a pc_name resolves host name to ip address via hostame in windows environment via NetBIOS and local network only nbtstat -A ip resolves IP to host name via IP in windows environment via NetBIOS and local network only nbtstat -c show local machine NetBIOS cache by IP nbtstat -n show local machine NetBIOS cache by name nbtstat -r NetBIOS Names Resolution and Registration Statistics nbtstat -R purge and preload of the NBT Remote Cache Name Table. nbtstat -RR NetBIOS names registered by this computer have been refreshed ++++++++++++++++++ Netshell Commands ++++++++++++++++++ netsh IP, DHCP, DNS configurations netsh interface ipv4 set dns name=”YOUR INTERFACE NAME” static DNS_SERVER e.g netsh interface ipv4 set dns name=”Wi-Fi” static 8.8.8.8 netsh interface ipv4 set dns name=”Wi-Fi” static 8.8.4.4 index=2. netsh interface ipv4 set dnsservers name”Wi-Fi” source=dhcp netsh interface ipv4 set address name=”YOUR INTERFACE NAME” static IP_ADDRESS SUBNET_MASK GATEWAY netsh interface ipv4 set address name=”YOUR INTERFACE NAME” source=dhcp netsh firewall show show firewall configs netsh interface ipv4 show config show IP configs netsh interface show interface show interfaces route print show route metric value and routing table net start start services net stop stop services ---------------------------------- NTP/Time Commands ---------------------------- time displays current time and set new as well if required Syntax time [/t | [[:[:]] [am|pm]]] /t Displays the current time without prompting you for a new time. C:\Windows\System32>net time net stop w32time net start w32time w32tm /unregister w32tm /register w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:manual /update (this NTP server can also be used = time.windows.com, time.google.com} w32tm /query /status w32tm /resync w32tm /query /peers >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> =============================== ⚙ FULL NETWORK RESET (Windows) =============================== ⚠ Run all commands in **Command Prompt (Admin)** ------------------------------------------------- 🧹 STEP 1: Reset Winsock (network socket layer) netsh winsock reset ------------------------------------------------- 🛠 STEP 2: Reset TCP/IP Stack netsh int ip reset ------------------------------------------------- 📡 STEP 3: Delete All Saved Wi-Fi Profiles (This will remove all remembered Wi-Fi networks) netsh wlan delete profile name=* ------------------------------------------------- ♻ STEP 4: Release and Renew IP Address ipconfig /release ipconfig /flushdns ipconfig /renew ------------------------------------------------- 🔁 STEP 5: Restart WLAN AutoConfig Service net stop wlansvc net start wlansvc ------------------------------------------------- 🔄 STEP 6: Disable and Enable Wi-Fi Adapter (Replace "Wi-Fi" with your adapter name if different) netsh interface set interface name="Wi-Fi" admin=disable netsh interface set interface name="Wi-Fi" admin=enable ------------------------------------------------- 🧪 STEP 7: Manually Set IP Address (For Testing) (Optional – use only if DHCP is failing) netsh interface ip set address name="Wi-Fi" static 192.168.1.100 255.255.255.0 192.168.1.1 netsh interface ip set dns name="Wi-Fi" static 8.8.8.8 ------------------------------------------------- ✅ STEP 8: Check Current IP Configuration ipconfig ------------------------------------------------- 📋 STEP 9: Show List of Network Interfaces (Use this to find your adapter name) netsh interface show interface =============================== 🚨 AFTER RUNNING: RESTART YOUR PC =============================== 💡 Tip: To create a batch file from this: 1. Copy all commands without comments. 2. Paste into Notepad. 3. Save as "network_reset.bat". 4. Right-click → Run as Administrator. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ *********************** BitLocker *********************** Run cmd as an Admin Manage-bde -lock F: Hit ENTER Manage-bde -unlock F: -password Hit ENTER Manage-bde -lock F: -ForceDismount *********************** system performance *********************** sfc/scannow cmd required in admin mode winget upgrade to check update available for installed applications winget upgrade --all to update all installed applications DISM/Online /Cleanup-image /restorehealth to restore corrupted files if any *********************** SERVER *********************** dsregcmd /status to check whether pc is joined in any Domain or not *********************** Hyper-V Hypervisor Enable for Sandbox etc. *********************** bcdedit to check Hyper-V launchtype systeminfo.exe to check Hyper-V status bcdedit /set hypervisorlaunchtype auto Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V *********************** GNS3 virtualization activation *********************** 1. cd "C:\Program Files\Oracle\VirtualBox" 2. VBoxManage modifyvm VMName --nested-hw-virt on note: no space in VMName how to install CISCO IOU l2 and CISCO IOU l3 Appliances or Switches in GNS3. Steps: 1-Install or Import Iou l2 image in GNS3 2-Install or Import Iou l3 image in GNS3 3-License iou l2 using GNS3 Virtual Machine open GNS3 VM from Virtual box via ssh in putty: port=22 Uname=gns3 pass=gns3 4- Generate IOURC License File. 5-Copy IOURC License 6-Past in IOS Section in GNS3. ================================== Commands to Execute: Open the Shell (VMware) I will use putty 1- wget http://www.ipvanquish.com/download/CiscoIOUKeygen3f.py 2- python3 CiscoIOUKeygen3f.py 3- ls 4- cat iourc.txt