You can use the following commands for the operations you have requested. First open a command prompt with elevated access (as Administrator): Start > type cmd****> Wait for a list to fill, right click Command Prompt and Run as Administrator. Once the window opens you can use:
- defrag.exe - To defragment drives
- chkdsk.exe - To check disks for errors
- shutdown.exe - To restart, suspend, shutdown PCs.
Once you run these commands particularly, a help will guide you on which options you can use the command with for every drive and operation aside.