Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus bios bsod computer crash driver drivers error ethernet excel freeze gaming gpu hard drive hardware hdmi internet laptop mac malware memory monitor motherboard music network printer problem ram registry router server slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
diskpart

Reply  
Thread Tools
madtrapper's Avatar
Computer Specs
Junior Member with 17 posts.
 
Join Date: Mar 2006
Location: HUDSON'S HOPE
Experience: Intermediate
10-Nov-2009, 02:13 PM #1
diskpart
how do i make a bat using
DISKPART>
DISKPATR> list disk
DISKPART> select (disk2)
DISKPART> clean all

thanks
TheOutcaste's Avatar
Computer Specs
Distinguished Member with 9,048 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
10-Nov-2009, 05:19 PM #2
Code:
Set _Script=dscript.txt
>"%_Script%" Echo.List Disk
>>"%_Script%" Echo.Select Disk 2
>>"%_Script%" Echo.Clean All
>>"%_Script%" Echo. Exit
Diskpart /s "%_Script%"
Del "%_Script%"
This will completely erase Disk 2 without confirmation, and will take some time as it writes zeros to each sector. It might be better to do this in 2 parts, to list the disks first, then ask for the disk number to erase (clean), confirm the selection with the appropriate warnings, then do the clean operation. Running this on the wrong PC could be disastrous, as the data on the disk will not be recoverable.

If there is no Disk 2, it will simply error on both the Select and Clean commands then exit.

Also, on Vista or later, the batch file will have to be run as Administrator
__________________
Microsoft MVP - Windows Expert - Consumer
Of course I know all the answers ; I just don't always match the answers to the right questions

madtrapper's Avatar
Computer Specs
Junior Member with 17 posts.
 
Join Date: Mar 2006
Location: HUDSON'S HOPE
Experience: Intermediate
10-Nov-2009, 05:36 PM #3
Smile diskpart
thanks trapper
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:25 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.