Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: DISKPART bat  (Read 18284 times)

0 Members and 1 Guest are viewing this topic.

seferismo

  • Guest
DISKPART bat
« on: September 23, 2009, 10:14:36 PM »
hi to all i just join this wonderful forum. i like computers and stuff like these kind of taste of programming, since i dont study programming my knowledge is bit little.



my point is i want to make a batch file to run DISKPART

 i started with still line
START C:\Windows\SYSTEM32\DISKPART.EXE

now for the part where i would need to set to choice to SELECT VOLUME 3 how do i add these kind of paremeters??? thanks  ;D

Salmon Trout

  • Guest
Re: DISKPART bat
« Reply #1 on: September 24, 2009, 12:49:51 AM »
You would create a text file with the commands you want Diskpart to execute, and then invoke Diskpart with the textfile path and name as one of the parameters.

http://blogs.msdn.com/embedded/archive/2005/12/23/506404.aspx

http://support.microsoft.com/default.aspx?scid=kb;en-us;300415


ourfear



    Greenhorn

  • Taking over the metaverse 1kb at a time
    Re: DISKPART bat
    « Reply #2 on: September 25, 2009, 07:09:15 AM »
    I actually wrote a batch file using diskpart and turned it into a USB Pen Drive Letter switching executable. The problem is that you cant hard code the Volume selection or the drive letter to assign it to!! So what i did was take the users input, export it into a text file and then run disk part against the text file using the -s (script)parameter.

    Here's my code if you'd like to take a look and the executable itself can be downlaoded from here:
     http://feartechsolutions.proboards.com/index.cgi?board=feartechprograms&action=display&thread=1

    Code: [Select]
    @echo off
    color 0E
    mode con lines=22 cols=86
    echo>list.txt
    echo>list.txt list volume
    @echo on
    diskpart -s list.txt
    @echo off
    set /p DLA=Enter desired volume:
    echo:
    set /p LTT=Enter drive letter:
    echo:
    echo>move.txt
    echo>move.txt list volume
    echo>>move.txt select volume %DLA%
    echo>>move.txt assign letter=%LTT%
    @echo off
    diskpart -s move.txt
    echo:
    Del /f "list.txt"
    Del /f "move.txt"
    echo:
    echo:
    pause
    exit /b

    Hope this helps  :D

    Russ