N+ tools and useful CMD


Welcome to N+ useful commands:


How to check the computer System Variable name like: %WinDir% 
PowerShell > Get-ChildItem Env:


Open CMD (command prompt):
%windir%\system32\cmd.exe


Please see A+ useful commands here:



How to stop CMD from scrolling when you issue a command:

Basically if you add that |more last option to any command, it will list one page at a time.

Command |more 
–Example below:

CMD > help |more 

————-
To go to the next page press:
space bar

To quit that command do a:
CTRL + C

————-
Help or more command or how to run that command:
Command   /?  



What is a CMD:
is a built-in Microsoft utilities, and most utilities are found at this folder (C:\Windows\System32 )
and they run by open up CDM.exe and then you enter the name of the utility inside that folder. Example:  POWERCFG power option utility
CMD > POWERCFG  /?

The option you can run like:
CMD > POWERCFG  -energy

Turn off hibernation:
powercfg -h off


/? is the user guide how to use it for that utility
If you do  /?   after the command this will tell the option that command has.
Basically you invoke that program function by issue the proper available option like: for example NETSH /? will have available functions you can run.



This program will find an ip address of that Switch. If you ever forget the IP address of a switch.
Protocols (CDP and LLDP), only work on layer 2 devices (Switch).
https://github.com/chall32/LDWin



NET
/?

A network services Commands
example:
Net Accounts /?

Stop and start a service using Net command: we will stop and start CagService.
Net Stop CagService

Net Start CagService


Netstat
is a useful tool for checking network and Internet connections such as for malware connections.
example:
netstat -a

Find out what program is using that port number: 162
netstat -ano|find “:162

Another example: Veeam
netstat -ano|find “:9392
*It should display as:  0.0.0.0:9392

or save the netstat result to: 
netstat -a -b -o > c:\myTemp\veeam_port.txt

*Then you can open up Task Manager,  search the PID to see the actual program name. 



Telnet or SSH protocol:
Allow remote connecting into that device like a server pc, switch, router.

“To see, if you can make a connection to that device.”
-Open up Putty, and Tenet to: Example
Veeam PC ip address with port: 9392
*You should get a connection error message as above.

*Telnet or SSH has to be enable on that device in order to make connection to it.



NBTSTAT
/?



Assign IP address via CMD:
CMD > netshinterface ipv4 set address /?
or
Window Key + R  > ncpa.cpl



TCP/IP and Networking Tools explain:

ipconfig: NIC configuration was assigned to it
Ping: the quickest way to see if that PC is reach able from here
Tracert: shows each step of the path taken from router to router (each hops on network)
Pathping: more detail like ping
Netstat: TCP connections and ports
Nslookup: its use to find the computer name corresponding to a numeric IP from a DNS Server records
Netsh: administration work
Net: network related
-extended Ping and Traceroute, “enter the command and hit enter after.”



Below is an example to show help information for the Net command:

Try the function keys, F1 to F9
F1
F7

cmd > net /?

————

Another example:
cmd > color a
cmd > color b
cmd > start notepad



How to disable the admin C share access using the Net command:

Net command are very useful in a network PC.  Will use net command to disable the c and admin share, no one can access the C drive.
Type the bottom into the folder explore address bar this will allow you browse that PC c drive. The bottom technique will disable it.
\\pc name \C$

1. Copy the bottom net command and save it as .bat and then place into the Startup folder.

net share c$ /delete
net share Admin$ /delete



Show routing table on that PC:
 

cmd > route print



Loopback Interface:
It is software version of the Physical Port, it is a virtual interface. You can’t plug cable into a virtual interface, because it is a software base of the Network card. You can use loopback interface the same way as the real network card. The only different is loopback interface never goes down. The only time it goes down if the devices is turn off. You may already know that a physical network card will go bad over time. This is why we use lookback interface to assigned to Switch or Router or PC. Then we can remote access those device using the loopback interface ip address instead of the physical network card when doing Telnet or SSH connection.
check to see if TCP/IP stack is not corrupted, try one of the bottom command.
How to ping PC loopback interface:
cmd > ping loopback
cmd > ping 127.0.0.1
cmd > ping localhost


Reset local user password with Net command:
Net user
John SuperCar86



Add user to a local PC administrator group with Net command:

Net localgroup administrators  john  /add


Add user to a local PC administrator group with GUI window:
Run > CMD > netplwiz 


To enable the local (built-in) Administrator account with Net command:
Net user administrator active /yes



Set up automaticly login to window 7:

cmd > netplwiz

….for window XP:
cmd > control userpasswords2



How to open up CMD on that remote PC.

This is useful for running a group policy update on that remote PC by running gpupdate.exe.
Or add a user to be a local administrator. Which allow the user to be a local administrator of that PC.
Which we going to do at the bottom (4sn5nd2 is the remote computer name, and we going to ask the remote PC to open up CMD and then do the Net command to add user domain myDomain\John to be a localgroup administrator.

1. Open up a CMD on your PC and type in the bottom command:
wmic
/ node:4sn5nd2 process call create “cmd.exe /c net localgroup administrators myDomain\John  /add”

—-
*The above wmic command only work within the same subnet of computer.
* Also, don’t forget to log off or reboot that PC for it to change. 



6 Hidden CMD trick



How to create a window service or delete a service from running


CMD is not as powerful, mean a very limit of tools available, while the window power shell you can basically do anything like GUI does.



COLOR: Change the background color

PROMPT: Change the command prompt url

TITLE: Change the title of the command prompt
POWERCFG    -engergy 

SHUTDOWN:

SYSTEMINFO:

System File Checker
SFC /scannow 

SCHTASKS: Schedule Tasks

NET USE: Map drives

CHKDSK: Check Disk

ATTRIB: Change File Attributes

BITSADMIN: Initiate upload or download and monitor the current state of those file transfers.

COMP: Compare two files to see the differences

FIND / FINDSTR: Search for strings inside of any ASCII files



Location of personal START menu

put a link to programs, this is useful if you want to add or modify the link to that program.
C:\Users\Jon_DOLE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs



More Control Panel .cpl
============================================
Collection of all of the .CPL (Control Panel short cut)
============================================

cmd > %windir%\system32\control.exe /name Microsoft.AdministrativeTools
——————————————————————

-Hold down Shift while Right Click > Run As Diffrent User
-Start Windows Command Prompt Win + R
-Start Command Prompt as Administrator Win + R, type cmd
-Access the new Windows Settings Menu Win + R, type ms-settings
——————————————————————

Windows Explorer:
explorer

Registry Editor:
regedit

Windows Services (local):
services.msc

Task Manager:
taskmgr

Classic System Configuration Utility:
msconfig

Classic Remote Desktop: one user can remotely use that PC
mstsc

Log Off Windows:
logoff

Shuts Down Windows:
shutdown

Command Prompt:
cmd

————————-
Open Documents Folder:

documents

Open Videos folder:
videos

Open Downloads Folder:
downloads

Open Favorites Folder:
favorites

Open Recent Folder:
recent

Open Pictures Folder:
pictures

Open C-Drive in Explorer:
c:
————————-

Device Management:
devmgmt.msc

Event Viewer:
eventvwr.msc

Computer Management including System Tools, Storage, Services:
compmgmt.msc

Disk Partition Manager:
diskmgmt.msc

Component Services:
dcomcnfg

Group Policy Editor: make change to the local PC
gpedit.msc

Local Security Policy Settings:
secpol.msc

Local User and Groups:
lusrmgr.msc

Performance Monitor:
perfmon.msc

Shared Folders: show all share folders
fsmgmt.msc

Network properties: show all network adapters
ncpa.cpl

To create a User account:
netplwiz

Devices Manager:
devmgmt.msc

——————
Classic Control Panel:

control

Classic File Explorer folder properties:
control folders

Classic Keyboard properties:
control keyboard

Classic Mouse Properties:
control mouse

Classic Printer properties:
control printers

Classic User Account Manager properties for the current user:
control userpasswords

Classic User Account Manager properties for all users:
control userpasswords2

Classic Administrative Tools:
control admintools

Classic System Information:
control system
——————

Classic Application Wizard:
appwiz.cpl

Classic Power Configuration:
powercfg.cpl

Classic date and time properties:
timedate.cpl

Classic Regional Settings:
intl.cpl

Classic Sound Properties:
mmsys.cpl

Classic Security Center:
wscui.cpl

Classic Internet Properties: open internet explore option
inetcpl.cpl

Classic System Properties:
sysdm.cpl

Classic Windows Firewall Properties:
firewall.cpl

——————
Start Windows Alarm App:
alarm

Start the Windows Calculator App:
calculator

Start the Windows Calendar app:

Start the Windows Camera App:
camera

Start the Windows Classic:
Control Panel control

Start Windows Edge App:
edge

Start Windows Get Help App:
gethelp

Start Windows Groove Music App:
groove

Start the Windows Mail app:
mail

Start Windows Map App:
maps

Start Windows Messaging App:
messaging

Start Windows Mixed Reality Portal App:
mixed

Start the Windows Office Hub App:
office

Start Windows OneNote App:
onenote

Start the Windows People App:
people

Start Windows Photo App:
photos

Start Windows Print 3D App:
print3d

Start Windows Skype App:
skype

Start Windows Sticky Notes App:
sticky

Start the Windows Store App:
store

Start Windows Voice Recorder App:
voice

Start Windows Weather App:
weather

Start Windows Whiteboard App:
whiteboard

Start Windows Your Phone App:
yourphone
——————

Adobe Acrobat:
acrobat

Adobe Photoshop:
photoshop

Google Chrome:
chrome

MS Excel:
excel

MS Access:
access

MS Word:
winword

MS PowerPoint:
powerpnt

Windows Media Player:
wmplayer

MS Paint:
mspaint

Wordpad:
write

——————
Display connection configuration:

ipconfig/all

Display DNS Cache contents:
ipconfig/displaydns

Delete DNS Cache contents:
ipconfig/flushdns

Release IP connections:
ipconfig/relase

Renew IP connections:
ipconfig/renew

Refreshes DHCP & Re-Register DNS:
ipconfig/registerdns

Display DHCP Class ID:
ipconfig/showclassid

Modifies DHCP Class ID:
ipconfig/setclassid
————

Create a shared folder Wizard:
shrpubw

Direct X Troubleshooter:
dxdiag

Clean Manager – Disk Cleanup Utility:
cleanmgr

Clipboard Viewer:
clipbrd

Windows Installer Details: use for silence install software
msiexec

Windows Magnifier:
magnify

On-Screen Keyboard:
osk

System Information:
msinfo32

Volume Control:
sndvol

Windows Version:
winver

Compare Files:
comp

MS-Dos FTP:
ftp

Volume Serial Number for C:
label

Bluetooth Transfer Wizard
fsquirt

Driver Verifier Utility:
verifier

Migration Wizard:
migwiz

File Signature Verification Tool:
sigverif

Fonts:
fonts

Game Controllers:
joy.cpl

Malicious Software Removal Tool:
mrt

Private Characters Editor:
eudcedit

————————————————–


An outside link to more CMD tutorial



Tips:

System Administrator: How to use Programs!
-1: You can use Google to search for info. and downloads programs.
-2: Right click, Hold  a certain key like Shift Key, Check the program options, Check programs (utilities) that came with that programs.
-3: You have to play with that software and know the inside and out of that program. Weather it is an Operating System like Window or VMWare software products or backup software like Veeam. You have to get it and play with it.
-4: How to turn On the Hardware and load / reload the software into it.


…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

2 thoughts on “N+ tools and useful CMD”

Leave a comment