Link to home
Start Free TrialLog in
Avatar of usslindstrom
usslindstromFlag for Japan

asked on

Is there a way to make DISKPART dynamic?

Experts,

We have a DISKPART script that singles out drives and basically formats and assigns a drive letter to the particular drive we're looking at.

This is all VERY static configurations, in that we target DriveID 0, 1, 2 etc.  Any time we need to change something, we need to update the script.

Is there a way to have DISKPART just go ahead and rip through all available drives and assign drive letters in sequence?

I've tried a VbScript to accomplish this, but if the obj.Drives.IsReady is false, there's not much I can do with the drive.

Would anybody happen to have any information on this sort of stuff?  Basically, I'd like to take all physical drives that aren't currently assigned a drive letter - and assign them the next available one on the system.  Including drives that are "offline", "not ready" or any other combination possible.
Avatar of ubound
ubound

According to the docs (http://technet.microsoft.com/en-us/library/cc766465%28WS.10%29.aspx), when using the ASSIGN command, "If no drive letter or mount point is specified, then the next available drive letter is assigned."
Avatar of usslindstrom

ASKER

Ah.  Thank you for that.  I didn't realize.

That will solve the issue of having to map them statically, but would you happen to know if it's possible to give DISKPART logic on the first half, where it grabs Drive0,1,2 etc. if they're not already assigned drive letters?
ASKER CERTIFIED SOLUTION
Avatar of ubound
ubound

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Acutally,

That's a very nice idea!  - I hadn't thought of piping to txt then parsing through VB.

I'll see what I can come up with.  Thanks for the ideas.