Useful Windows Commands

From Jeff's Weather Service ~ Wiki Page
Jump to: navigation, search

Written on 1/17/2011 at 9:50pm

Last Update on 11/7/2014 at 6:00pm

Admin Commands

System File Checker

sfc /scannow

File Signature Verification

sigverif

Driverquery

driverquery
driverquery -v
driverquery -si

Nslookup

nslookup jeffsweatherservice.com

Ping

ping jeffsweatherservice.com

Ipconfig

ipconfig /all
ipconfig /release
ipconfig /renew
ipconfig /flushdns

Tasklist

tasklist

Taskkill

taskkill -pid 4104
taskkill -im iexplore.exe

System commands

System Information (user-interface)

msinfo32

System Information (command-line)

systeminfo

System Up Time

systeminfo|find "Up Time"

System Reboot

shutdown -r -t 0


Serial Number

This requires being logged in as an admin user.

wmic bios get serialnumber

System time and date

time 
date

System File Check

sfc

Network commands

To determine Gateway

route PRINT

To ping

ping <server IP address or server name>

Example:

ping CSR-TVC

To determine IP address info

ipconfig

Wireless Network speeds

netsh wlan show all
netsh wlan show interfaces
netsh wlan show networks

Disabling Receiver Side Scaling

  • Note: Run as Administrator from Command Prompt.
  • This resolved TCP traffic stops.
netsh interface tcp show global
netsh interface tcp set global rss=disabled

To setup NTP

For Windows XP:

net time /querysntp
net time /setsntp:<server>

Example:

net time /setsntp:time-b.nist.gov
net stop w32time
net start w32time
w32tm /resync

For Windows 7:

  • Check status:
w32tm /query /computer:laptop /peers
  • Update config:
w32tm /config /computer:laptop /manualpeerlist:desktop /syncfromflags:manual /update 
  • Resync clock:
w32tm /resync /computer:laptop /nowait

To restore the Windows Time Service if it has been broken.

net stop W32Time
w32tm /unregister
w32tm /register
net start W32Time
sc query W32Time

To query ntp:

w32tm /query /status

To mount Samba Shares

To query what is mounted:

net use 

To mount at boot up:

  • Note: Run as Administrator from Command Prompt.
net use w: \\desktop\backup /p:yes

To delete mount:

net use w: /delete

To delete all mounts:

net use * /delete

Robocopy

Windows 7:

"C:\Windows\system32\robocopy" \\source-system\folder \\destination-system\folder /e /R:0 /W:0 /MT:16

Examples:

"C:\Windows\system32\robocopy" \\laptop\install\ \\laptop\install /e /R:0 /W:0 /MT:16
"C:\Windows\system32\robocopy" "C:\Users\Home" "D:\Users\Home" /mir /e /R:0 /W:0 /XJ /MT:16

"C:\Windows\system32\robocopy" "C:" "D:" /E / /COPYALL /R:0 /TEE /LOG:"D:\robo-log.txt"
"C:\Windows\system32\robocopy" "C:" "D:" /MIR /E /COPYALL /R:0 /TEE /LOG:"D:\robo-log.txt"

Windows Vista:

"C:\Windows\system32\robocopy" \\source-system\folder \\destination-system\folder /MIR /Z /XA:H /XJ /W:0

Example:

"C:\Windows\system32\robocopy" C:\Users\Home D:\Users\Home /MIR /Z /XA:H /XJ /W:0

To speed up slow file copy in Windows Vista, do the following:

  1. Disable Navigation Pane (Organize -> Layout -> Naviagtion Panel
  2. Map a network drive
  3. Use Robocopy
  4. Disabling automatic adjustment of TCP window size
    • netsh interface tcp set global autotuninglevel=disabled

Other commands

Check Disks

chkdsk

Stop and restart services

net stop <service>
net start <service>
Examples:
net stop "wsi hawkeye local monitor"
net stop sbacq_service
net stop rqtgenerator
net start pgsql-8.3
net start pgsql-8.3
net start "wsi hawkeye local monitor"

Remove directories

rmdir /S /Q <directory>
Example:
rmdir /S /Q MyFolder

Remove directories that fail due to long file names

To delete the directory tree starting at c:\subdir\more\offending_dir:

The total step-by-step-process is as simple as this:

  1. cd c:\subdir\more to cd into its parent directory.
  2. mkdir empty to create an empty directory.
  3. robocopy empty offending_dir /mir to mirror the empty directory into the offending one.
    • After some waiting you're done! Finish it up with:
  4. rmdir offending_dir to get rid of the now empty offending directory and
  5. rmdir empty to get rid of your intermediate empty directory.