I wipe a lot of hard drives in work and was wondering how i could go about getting diskpart to run automatically. can it be done with a batch file? the commands i run are SELECT DISK 2 CLEAN CREATE PARTITION PRIMARY FORMAT FS=NTFS QUICK ACTIVE ASSIGN any help would be great thanks
for diskpart you can't put the diskpart inside a batch script as it opens its own shell, you need to do.. diskpart /s diskpart.txt you have to make a text files called diskpart.txt and put it inside one of your "paths". inside diskpart.txt put.. SELECT DISK 2 CLEAN CREATE PARTITION PRIMARY FORMAT FS=NTFS QUICK ACTIVE ASSIGN EXIT Thought I have never tried it, you could probably then make a batch file of the diskpart /s diskpart.txt Somethin like, @echo off echo About to run diskpart... diskpart /s diskpart.txt echo Diskpart complete! pause To save the above bit as a batch file, put it in a text file and change file type to all files and save as whatever.bat then it will be a batch file Then it should hopefully run diskpart with your text file input, then pause for input before it closes the script window. (to see what/where your paths are, open cmd and write "set" then look for PATHS, it should be a list of folders where you can have stuff and just reference it from command line and it will use it without having to have the full path input, you can add and change these paths.) EDIT: found it, here is the microsoft KB about scripting diskpart http://technet.microsoft.com/en-us/library/cc766465(WS.10).aspx if you look towards the bottom it says exactly what you want to do.
its so much harder using powershell! I dont think its a very good idea. Its only viable using powershell becuase it sits ontop of .net. I don't think it represents a very elegant solution.
You do know that's not a secure way of wiping a disk. All the data will still be recoverable because a 'quick' format doesn't physically overwrite any data it just sets the partition table to say it's all blank.
we got a pretty got solution for wiping drives, this is a seperate thing, thanks for the info guys, will have a go at it later +rep