Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Batch File Question

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,35404
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> Batch File Question
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Batch File Question - 6/13/2006 8:13:03 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
Original message moved by Country73
Reason : Moved to a more suitable forum
Who knows how to alter this to use Diskpart to remove NTFS drives. At the moment this only does FAT.
@ECHO OFF
IF EXIST "A:\FORMAT.TXT" GOTO FORMAT
IF NOT EXIST "A:\FORMAT.TXT" GOTO FDISK

:FDISK
ECHO This system will reboot when complete.
ECHO.
ECHO Deleting all current partitions ...
FDISK /CLEAR > NUL
ECHO Creating new partitions ...
FDISK /AUTO > NUL
ECHO. > A:\FORMAT.TXT
GOTO REBOOT

:REBOOT
FDISK /REBOOT

:FORMAT
ECHO Formatting drive ...
FORMAT drive /AUTOTEST /V:label /S
DEL A:\FORMAT.TXT
GOTO END
:END
CLS
ECHO FINISHED FDISK AND FORMAT
 
 
Post #: 1
 
 RE: Batch File Question - 6/15/2006 11:54:52 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Diskpart can make use of an answer file.

Here is one that I use in my Windows Setup process

My answer file

      

The command you would use
Diskpart /s c:\folder\nameoffile.txt

Now, what does the above command do.

select disk 0 - Select the first disk on the PC
clean - wipes the drive clean, removing all partitions (i.e. if you had 2 partitions when you started, they would be gone)
create partition primary - create the partition
assign letter=C - assign the above partition the letter C
active - make the above partition active
exit - exit diskpart

Once this was done, all you would have to do is format the drive with whatever FS you want.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to gdewrance)
 
 
Post #: 2
 
 RE: Batch File Question - 6/19/2006 12:19:51 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
I tried this. It gave me an error that it could not be run in DOS.
Can it step through all partitions and delete them
@ECHO OFF
IF EXIST "A:\FORMAT.TXT" GOTO FORMAT
IF NOT EXIST "A:\FORMAT.TXT" GOTO FDISK


:FDISK
Diskpart /s A:\DiskpartFormat.txt
GOTO REBOOT

:REBOOT
FDISK /REBOOT

:FORMAT
ECHO Formatting drive ...
FORMAT C: /AUTOTEST /S
DEL A:\FORMAT.TXT
GOTO END
:END
CLS
ECHO FINISHED FDISK AND FORMAT

NOTE: My DiskpartFormat.txt is what you posted.

(in reply to mbouchard)
 
 
Post #: 3
 
 RE: Batch File Question - 6/19/2006 10:36:14 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
FDisk <> Diskpart.

Diskpart is, essentially, a 32bit version of FDisk.  I had thought you were looking at switching from FDisk to DiskPart.  As far as I know, you can not run diskpart in DOS.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to gdewrance)
 
 
Post #: 4
 
 RE: Batch File Question - 6/19/2006 10:49:19 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
There used to be a third party app called diskpart that I used on NT4 that was dos based.
I think there might be one on Hirens Boot CD. I will have a look and see what I can find.
I tried free Fdisk but, still need to see if its got command line switches.
Thanks for the help

(in reply to mbouchard)
 
 
Post #: 5
 
 RE: Batch File Question - 6/20/2006 6:43:22 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Ahh, wasn't aware of the 3rd party app.  The Diskpart I use came from MS, with 2000/XP

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to gdewrance)
 
 
Post #: 6
 
 RE: Batch File Question - 7/21/2006 1:11:22 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
My mistake its Delpart

(in reply to mbouchard)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> Batch File Question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts