Andrew
Tue Sep 13 13:40:22 CDT 2005
I am sorry I did not make myself clear. I want to run diskpart using a
script file. The script file will have the following:
list disks
exit
I want to pipe the result to a text file. I have been able to do this by
running the command "diskpart -s commandlist.txt > c:\disklist.txt"
I get a single string with control characters in the text file however if I
write it out to a .doc I can open it in word pad and the results are
readable.
The reason I want to do this is the drive I am trying to import will not
always have the same disk number because I want this script to run on
different machines. I will parse the output file and determine which disk I
want to target and then build another script file for diskpart from the
results.
--
Andrew C. Madsen
Network Specialist
Harley-Davidson Motor Company
"DiGiTAL SKReAM" <DiGiTAL.SKReAM@gmail.foo.com> wrote in message
news:OYooL0IuFHA.1472@TK2MSFTNGP15.phx.gbl...
> Diskpart can read it's values from a text file witht eh appropriate
> commands listed in order. Here is the way that you would call diskpart
> from vbscript:
> (The line may wrap, so remember it is all one line)
> WshShell.Run "c:\tools\diskpart.exe /s c:\tools\MakeVol.txt", 1, True
>
>
> And here is a sample of such a MakeVol.txt file:
>
> REM This is an automated Disk Partition Script.
> REM
> REM -----------Start----------------
>
> REM Show available disks
> list disk
>
> REM Select which disk to create simple volume on
> REM disk 0 = physical C: drive, disk 1 = physical D: drive, etc.
> select disk 1
>
> REM Create the volume with a particular size
> REM create partition primary size=34707
> REM Create the volume with using all available space
> create partition primary
>
> REM Assign drive letter to new volume
> assign letter=d
>
> REM Show available disks
> list disk
>
> REM Select a particluar drive, partition, volume
> select disk 0
> select partition 2
> select volume 2
>
> REM change it's drive leter / Assign a drive letter to the selection
> above
> assign letter=Y
> REM
> REM ----------- End ----------------
>
> Hope this helps,
> DS
>
> ---
> Life is all about ass; you're either covering it, laughing it off,
> kicking it, kissing it, busting it, trying to get a piece of it,
> behaving like one, or living with one!
>
> *** Sent via Developersdex
http://www.developersdex.com ***