In Windows cmd(Command prompt) is important for various tasks, for programmers or for daily windows users, so here in this article, I am going to explain and write about top useful command prompt commands, which are very helpful for users and they make your task easy.
This command is used to delete your files permanently from your system, actually, when we delete it for first they don't get deleted for all that's why we can recover it using some utility tools.Instead, it marks the files as no longer accessible and the space they took up as free. The files remain recoverable until the system overwrites them with new data, which can take some time.
So to clean all the data from your c: drive you’d use the command “cipher /w:c”, which will wipe free space on the drive.The command does not overwrite undeleted data, so you will not wipe out files you need by running this command.
We should use this command periodically. Check Disk examines disks and can correct many types of common errors on FAT16, FAT32, and NTFS drives. One of the ways Check Disk locates errors is by comparing the vol¬ume bitmap with the disk sectors assigned to files in the file system. Check Disk can’t repair corrupted data within files that appear to be structurally intact, however. You can run Check Disk from the command line or through a graphical interface.
The complete syntax for Check Disk is as follows:
CHKDSK [volume[[path]filename]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]
chkdsk D: /r /f
3. netstat -an
The netstat command is used to query TCP/IP about the network status of the local host, basically, it helps in displaying all sorts of local network statistics when used with its various options.
- -netstat-- -a-- -e-- -n-- -o-- -p--proto-- -r-- -s--interval
Detailed info about syntax is here
One interesting command is netstat-an, which will display a list of all open network connections on their computer.
ping command is used to detach if a computer can reach to the specific destination, it is usually used as a simple way verify that a computer can communicate over the network with another computer or network device.
For example, you can check if you can connect to google using this command, Google will respond and let you know it’s received them. You’ll be able to see if any packets didn’t make it to Google.com, if there is any packet loss or if you are hearing back from them
Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Used without parameters, IP config displays the IP address, subnet mask, and default gateway for all adapters.However, if you’re behind a router (like most computers today), you’ll instead receive the local network address of the router.
ipconfig [/all] [/renew [Adapter]] [/release [Adapter]] [/flushdns] [/displaydns] [/registerdns] [/showclassid Adapter] [/setclassid Adapter [ClassID]]
ipconfig is useful because of its extensions. “ipconfig /release” followed by “ipconfig /renew” can force your Windows PC into asking for a new IP address, which is useful if your computer claims one isn’t available. You can also use “ipconfig /flushdns” to refresh your DNS address. These commands are great if the Windows network troubleshooter chokes, which does happen on occasion.
PowerCFG (executable name
powercfg.exe) is a command-line utility that is used from an elevated Windows Command Prompt to control all configurable power system settings, it is a very powerful command for managing and tracking how your computer uses energy. You can use the command “powercfg /hibernate on” and “powercfg /hibernate off” to manage hibernation, and you can also use the command “powercfg /a” to view the power-saving states currently available on your PC.
“powercfg /devicequery s1_supported”, which displays a list of devices on your computer that support connected standby. When enabled, ou can use these devices to bring your computer out of standby – even remotely. You can enable this by selecting the device in Device Manager, opening its properties, going to the Power Management tab and then checking the “Allow this device to wake the computer” box.
"powercfg /energy", analyzes the system for common energy-efficiency and battery life problems. The
/energy command should be used when the computer is idle and with no open programs or documents. The
/energy command will generate an HTML report file in the current path.
7. recimg- for Windows 8
"Refresh your PC" is a new feature in Windows 8. By default, desktop apps are removed when you refresh a Windows 8-based computer unless you create a custom image. It allows you to restore your computer’s system state to its original state, either from a clean Windows install or as the computer came from its manufacturer. You can create your own custom recovery images, but this feature is hidden , you have to do it with the recimg command from a command line.
If you don’t about your file system or file extension and uses of that very file then you can try this command to see the list of extension and details about file extension. It also uses to change the associated file extension of file type with the file extension.
The ASSOC command itself will reveal both the extension names and program names for a file, which will help you properly use this command.
You can use the “tasklist” command to provide a current list of all tasks running on your PC. Though somewhat redundant with Task Manager, the command may sometimes find tasks hidden from view in that utility.
DiskPart.exe is a text-mode command interpreter that enables you to manage objects (disks, partitions, or volumes) by using scripts or direct input from a command prompt. Before you can use DiskPart.exe commands on a disk, partition, or volume, you must first list and then select the object to give it focus. When an object has focus, any DiskPart.exe commands that you type to act on that object.
You can list the available objects and determine an object's number or drive letter by using the list disk, list volume, and list partition commands. The list disk and list volume commands display all disks and volumes on the computer. However, the list partition command only displays partitions on the disk that has focus. When you use the list commands, an asterisk (*) appears next to the object with focus. You select an object by its number or drive letter, such as disk 0, partition 1, volume 3, or volume C.
It contains many commands which are shown here. You can see the command here
DISKPART> san policy=OnlineAll DiskPart successfully changed the SAN policy for the current operating system. DISKPART> LIST DISK Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 80 GB 0 B Disk 1 Offline 30 GB 1024 KB DISKPART> select disk 1 Disk 1 is now the selected disk. DISKPART> ATTRIBUTES DISK CLEAR READONL DISKPART> ONLINE DISK DiskPart successfully onlined the selected disk.