I have 2 scripts for imaging new PCs. 1 for if the PC has a CD rom and one for if it does not:
With CD Rom:
select disk 0
clean
create partition primary
select volume 1
assign letter="C"
format quick fs=ntfs
active
exit
Without CD Rom:
select disk 0
clean
create partition primary
select volume 0
assign letter="C"
format quick fs=ntfs
active
exit
I'm looking for a way to combine these into one script that will basically decide if volume 0 is a hard drive or cd rom, then execute one or the other scripts above based on a YES hdd or YES cd-rom.
I'm not sure if this is better done with Powershell or if an If statement can be working into a Diskpart Script or if all of this can be done with a simple CMD batch file.