Useful Windows Command Tips

Useful Windows Command Tips

Run with different user account
command prompt >> runas /user:domain\userId cmd
lunch window explorer  (on window 10) >> runas /noprofile /env /user:domain\userId /netonly explorer
lunch google Chrom >> C:\Windows\System32\runas.exe /profile /user:domain\userId  "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

Shutdown
  shutdown.exe -r -t 00

Lock Workstation
  rundll32.exe User32.dll,LockWorkStation

Hibernate
  rundll32.exe PowrProf.dll,SetSuspendState

Sleep
  rundll32.exe PowrProf.dll,SetSuspendState 0,1,0

List all processes on a windows machine
on cmd.exe: tasklist

on Powershell: get-process

Check outbound & Inbound port from windows (from Power Shell execute below command)
on Powershell: Test-NetConnection -InformationLevel detailed -ComputerName portquiz.net -Port 4022 

on Powershell: Test-NetConnection -ComputerName localhost -Port 4022


Reasons Behind "The  file or directory is corrupted and unreadable"
Some time file/folder unable to copy/move/delete on Windows OS (win8 onwards)

"The file or directory is corrupt and unreadable" is a common error that usually occurs due to an issue with external hard drives. The error message is displayed when Windows cannot read or access the external hard drive. There are a lot of reasons may lead to this error and fortunately, here are fixes available.

One common fix I found is : Perform a Disk Check on Windows 10/8.1/8/7

1. Launch cmd on your Windows PC via the Start Menu. Run it as administrator.

2. Type chkdsk /f e: in the Command Prompt window and press Enter to execute the command. e here is the drive letter of the corrupted partition that you want to check.


Comments

Popular Posts