Useful Command Prompt tricks & hacks #1

command prompt

To have full control over the windows operating system its necessary to know some useful commands, most of these tools don’t have graphical equivalents, some are hidden while some, though they have their graphical equivalents, using the CLI (Command Line Interface) to access them will be faster.

Few of these commands require you run CMD (Command Prompt) as an administrator, to access CMD press down the windows logo button on your keyboard as you press R ( + R), type CMD then hit ok, you can also use the search feature provided by Windows, take your mouse pointer to the lower right corner of your screen, an additional side menu appears making the search icon visible, select it then type CMD, you can right click and select Run as Administrator. The Power User Menu in Windows 10 is a much faster way to access Command Prompt, hold the windows logo key + x  ( + x) then choose Command Prompt. Here are few useful commands, ignore the quotes;

ipconfig: The “ipconfig” command displays the IP Address your computer is currently using and also a list of all the network connections your computer uses. If you are connected to Wi-Fi, look under Wireless LAN or if connected to Wired Network look under the Ethernet Adapter Local Area Connection. ipconfig can be used followed by other extensions, “ipconfig/release” followed by “ipconfig/renew” can force your Windows PC into asking for a new IP, this is useful especially if your PC claims one that isn’t available.

shutdown: The shutdown command is useful if you want to create your own shutdown shortcuts without having to pass through the GUI provided. This command can also be used to restart your PC (Zero (0, specifies the time in seconds at which you want the PC to shutdown) . To shutdown use “shutdown /s /t 0”, to restart use “shutdown /r /t 0”. To shutdown a computer remotely (say in a network) use “shutdown /i”. Read our previous on how to keep people away from your PC

sfc /scannow: The “sfc /scannow” command helps you to scan system files for errors. In windows OS where system files are either corrupted or missing, executing this command may help fix the problem, it requires running CMD as an administrator.

cipher: The “cipher” command helps to permanently delete and overwrite a directory. Sometimes, deleted files are still accessible in a disk (unless its an SSD, Solid State Drive), these files remain recoverable until they are overwritten with new data. The “cipher” command allows you to wipe a drive completely by writing random data to it. To achieve this key in “cipher” and specify the drive e.g “cipher /w:c”, this will wipe free disk space on the drive, this command doesn’t over write undeleted data, so running the command doesn’t wipe out files you need

netstat: “netstat” command displays network statistics with other options. Using “netstat -an” will display a list of all open network connections along with the port used, and foreign IP addresses connected to. This is also useful if yoiu are trying to troubleshoot devices your computer is connected to or if you are trying to locate a malicious connection.

assoc: Files in windows are open by default with a specific program e.g text files (.txt) are opened by Note pad. The “assoc” command displays a list of file extensions and the programs they are connected with. You can also perform other functions using the “assoc” command e.g “assoc txt =” changes the default association for text files to any other program you key in after the equal sign.

driverquery: The “driverquery” command displays a list of drivers in your system, “driverquery -v” gives more info including the directories in which the drivers are installed and also the driver status, this could help you trouble-shoot driver related problems and also know which is functioning and which isn’t.

powercfg: The “powercfg” command helps you to manage and track how your computer uses energy. To view the power saving states available on your pc use “powercfg /a” to check your battery status and recommendations on how to make it last longer use “powercfg -energy”. Another important command is the “powercfg /devicequery s1_supported”, this command displays a list of devices on your computer that supports connected standby, when enabled these devices can be used to bring your PC out of standby even remotely. To enable this, select the device in device manager, open its properties then go to the power management tab and check “Allow this device to wake the computer”. For other power functions use “powercfg /help”.

tasklist: “tasklist” command will provide a list of tasks currently running on your computer. “tasklist -v” will provide details on each task, “tasklist -m” will locate .dll files which are associated with active tasks

taskkill: This can be used to kill a task, to force stop a program use “taskkill -im” followed by the executable name or “taskkill -pid” followed by the process ID. This can be seen in the tasks that appear in the “tasklist” command, the tasks have an executable and process ID associated with them.

taskkill technicollit

Using taskkill to kill tasks generated by tasklist, enter taskkill -im followed by task code

ping: “ping” is a diagnostic command which is used to verify basic TCP/IP connectivity to a networks host. to use it the “ping” command followed byt the host name or IP address you intend to test

repair-bde: When drives encrypted with Bitlocker have problems, using the “repair-bde” could help you recover data the data in it. To use this command you need a destination drive where the recovered data can be written, as well as the Bitlocker recovery password you used. When using this command, ensure you specify the source drive, destination drive, the recovery key or password and the path to the recovery key or password. Use repair-bde /help to see more.

Others include

netuser: Use this command to view your account, you can also change your account password, add more accounts etc. Use net user /help for more.

nslookup: Use this command to know the IP address of a website try “nslookup technicollit.com”.

sigverif:  This command will check to see if all system files are digitally signed,

arp: Displays & modifies the IP to physical address translation, used by address resolution protocol (ARP)

attrib: Displays hidden files (use attrib/?)

bcdboot: Used to copy critical boot files to the system partition & to create a new system BCD store

bcdedit: Used to edit boot configuration data

tree: Creates a map showing you directories on your computer drives

mmc: Snap in console where most system settings are

rstrui: Starts system restore

mstsc: Remote desktop connection

perfmon: to view the performance monitor

taskmgr: opens up task manager

msinfo32: reveals system properties

set: displays set or removes windows environment variables. also shows processor info

mdsched: fixes memory problems on your computer

mode: Configures system devices. Changes graphics modes, adjusts keyboard settings, prepares code pages, and sets up port redirection.

You can RUN TWO COMMANDS SIMULTANEOUSLY with the command prompt, all you need do is input “&&” inbetween two commands. the command on the left will execute first before the one on the right e.g “tasklist&&rstrui” displays task running on your system and also opens the System Restore dialog box.

Conclusion

There are literally hundreds of windows command available and this article doesn’t cover half of them, though some are not useful anymore because they have been replaced with GUI (Graphic User Interface) most useful commands will be offered here from time to time .



There are no comments

Add yours