diskpart an ssd from a cmd command

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
wchristner
Posts: 24
Joined: 06 May 2014 09:55
Location: North West Indiana

diskpart an ssd from a cmd command

#1 Post by wchristner » 06 Nov 2015 11:18

I need to figure out how to automate a cmd file to run diskpart. We use an Imagex to image new laptops. We replace the standard 500gig sata drive with a 240gig Kiingston SSD. when we run the script it fails to reconize the script below.

diskpart /s fullpart.txt

imagex /apply 7_0629.wim 1 c:

this points to a diskpart file with the commands: ...any ideas on how I can get this to work? Thanks
the drive needs to be formated as they are new from the factory, I believe a low level format is how they come in and can't be imaged until properely formatted. the primary partiton needs to be created for the image to install.

select disk 0
clean
create partition primary
active
assign letter=c
for fs=ntfs quick
exit

Squashman
Expert
Posts: 4471
Joined: 23 Dec 2011 13:59

Re: diskpart an ssd from a cmd command

#2 Post by Squashman » 06 Nov 2015 12:35

Are you allowed to abbreviate the FORMAT option like that?
Seems like it would be easy enough to troubleshoot if you just manually ran each command one at a time on one computer to figure out the problem.

Docfxit
Posts: 130
Joined: 12 Nov 2015 12:42

Re: diskpart an ssd from a cmd command

#3 Post by Docfxit » 12 Nov 2015 13:51

Try this:

SELECT DISK %diskNumber%
CLEAN
CREATE PARTITION PRIMARY
FORMAT FS=ntfs quick label="MyNewDrive"
ACTIVE
Exit

Docfxit

Post Reply