If you haven't checked out the PsTools suite yet, go look it up (download link is at the bottom of this post). It contains several handy tools to work on other machines remotely via command prompt.
My favorite and most used PsTool is psexec. Psexec allows you to execute commands from a command prompt for another machine. There are two methods to do this -
From an elevated command prompt (right click command prompt & run as administrator):
psexec \\JenniPC -s cmd.exe
Replace JenniPC with the name of the remote machine you are trying to run the command on. The
-s causes the command to be run under the System account.
This command changes the command prompt window to be connected instead to the remote machine. For example, after running this command, if you run the command hostname it should return the hostname of the remote machine. Cool, huh?
If you don't want to open/change the command prompt, you can just add your specific command to the end of the psexec command line. For example:
psexec \\JenniPC -s ipconfig
This runs ipconfig on remote computer JenniPC and returns the ipconfig output for that machine in the DOS box.
There are a few GUIs out there you can get for the tools, but none of them are perfect. For example, FrontEnd for PsTools is good, but if you try to run ipconfig under the psexec it doesn't return the correct output - or any output for that matter.
Knowing how to navigate and use a command prompt is a neat skill to have so learning how to use PsTools from cmd.exe is worthwhile and more fun anyway in my opinion.
Resources:
PsTools Download: https://technet.microsoft.com/en-us/sysinternals/pstools.aspx
FrontEnd for PsTools: http://www.davitools.com/fepstools/
PsTools GUI: http://sourceforge.net/projects/pstoolsgui/
Click on Pictures to View
To view a larger version of an image within a post, just click on the picture you want to view :)
Showing posts with label command prompt. Show all posts
Showing posts with label command prompt. Show all posts
Wednesday, December 16, 2015
Wednesday, July 22, 2015
How to Quick Format a Drive - Command Prompt
Knowing how to format a drive, whether a hard drive or flash drive, can come in very handy. This article will briefly go over the types of file systems for disk partitions followed by how to format a drive - first using a command/DOS prompt. I'll go over how to format using HP USB Storage Format Tool v2.2.3 in another post.
The most common choices for formatting are FAT32 and NTFS.
FAT32 is the older of the two formats and is read/write compatible with many operating systems, including Windows up to Windows 8, Mac OS X, and Linux. It supports file sizes up to 4GB and up to 2TB volumes. Also, FAT32 can be converted to NTFS without reformatting.
NTFS (New Technology Files System) is the newer drive format and is read/write compatible with legacy Windows operating systems such as Windows NT 3.1 up to Windows 8. Mac OS X (10.3 and above) can read NTFS, but (aside from other hacks and workarounds) they require third party utilities to write to an NTFS volume, making NTFS essentially only semi-compatible with OS X.. NTFS cannot be converted to FAT32 without reformatting.
While NTFS is supposedly faster than FAT32 formatted drives, FAT32 makes for a better choice if you ever need to transfer files between Windows and non-Windows systems (like Mac or Linux machines).
*The below instructions are assuming an external drive of some sort is being formatted from within Windows. You can also format your internal hard drive if needed for an OS (re)install if you have the install media readily available of course!)
HOW TO QUICK FORMAT VIA COMMAND PROMPT (cmd.exe):
Type the following commands line by line in an elevated command prompt (elevate a cmd prompt by right clicking cmd.exe and select "Run As Administrator")
Type:
**For the next command you will need to use your common sense as to which drive to select. For example, if you know you have a 500GB hard drive internally, and want to format a 16GB flash drive that's connected, probably only two drives will be listed under "list disk" - Ex: Disk 0 shows as having a size of 500GB and Disk 1 as having a size of 16GB. You will therefore want to "Select disk 1" (the flash drive - you do not want to unintentionally format your internal hard drive!). You can also go to Disk Management (under Computer Management, along with Device Manager) and look at the drive numbers there.**
More resources on NTFS vs FAT32:
http://www.pcmag.com/article2/0,2817,2421454,00.asp
http://www.guidingtech.com/11205/difference-between-ntfs-and-fat-32-file-systems/
http://www.howtogeek.com/177529/htg-explains-why-are-removable-drives-still-using-fat32-instead-of-ntfs/
More resources on using Diskpart to format a drive:
http://www.techhack.co.uk/2011/03/31/format-a-hard-drive-with-command-prompt/ - with screen shots
http://www.intowindows.com/bootable-usb/ - includes info on making a USB bootable (more to come in a future post!)
The most common choices for formatting are FAT32 and NTFS.
FAT32 is the older of the two formats and is read/write compatible with many operating systems, including Windows up to Windows 8, Mac OS X, and Linux. It supports file sizes up to 4GB and up to 2TB volumes. Also, FAT32 can be converted to NTFS without reformatting.
NTFS (New Technology Files System) is the newer drive format and is read/write compatible with legacy Windows operating systems such as Windows NT 3.1 up to Windows 8. Mac OS X (10.3 and above) can read NTFS, but (aside from other hacks and workarounds) they require third party utilities to write to an NTFS volume, making NTFS essentially only semi-compatible with OS X.. NTFS cannot be converted to FAT32 without reformatting.
While NTFS is supposedly faster than FAT32 formatted drives, FAT32 makes for a better choice if you ever need to transfer files between Windows and non-Windows systems (like Mac or Linux machines).
*The below instructions are assuming an external drive of some sort is being formatted from within Windows. You can also format your internal hard drive if needed for an OS (re)install if you have the install media readily available of course!)
HOW TO QUICK FORMAT VIA COMMAND PROMPT (cmd.exe):
Type the following commands line by line in an elevated command prompt (elevate a cmd prompt by right clicking cmd.exe and select "Run As Administrator")
Type:
- Diskpart
- List Disk
**For the next command you will need to use your common sense as to which drive to select. For example, if you know you have a 500GB hard drive internally, and want to format a 16GB flash drive that's connected, probably only two drives will be listed under "list disk" - Ex: Disk 0 shows as having a size of 500GB and Disk 1 as having a size of 16GB. You will therefore want to "Select disk 1" (the flash drive - you do not want to unintentionally format your internal hard drive!). You can also go to Disk Management (under Computer Management, along with Device Manager) and look at the drive numbers there.**
- Select disk <insert disk #>
- Clean
- Create partition primary (or create part pri for short!)
- Format fs=NTFS quick *OR* Format fs=FAT32 quick
- List volume (or list vol for short!)
- Select volume <insert volume #> (use the same judgement you used earlier when selecting a disk number to select the volume number of the drive you just formatted)
- Assign
- Exit
More resources on NTFS vs FAT32:
http://www.pcmag.com/article2/0,2817,2421454,00.asp
http://www.guidingtech.com/11205/difference-between-ntfs-and-fat-32-file-systems/
http://www.howtogeek.com/177529/htg-explains-why-are-removable-drives-still-using-fat32-instead-of-ntfs/
More resources on using Diskpart to format a drive:
http://www.techhack.co.uk/2011/03/31/format-a-hard-drive-with-command-prompt/ - with screen shots
http://www.intowindows.com/bootable-usb/ - includes info on making a USB bootable (more to come in a future post!)
Subscribe to:
Posts (Atom)