tags:

views:

150

answers:

1

I have a VBscript that outputs various config items about a system. Both hardware and software. I can output disks and their associated partitions. I can output mount points. I do not seem to be able to associate a mount point with a local disk (where it actually is a local disk).

I need to be able to do this using VBscript, so as to fit in with the rest of the ~2000 lines of code. I do NOT want to run some other program graphically. I know the disk manager service can show me (My Computer -> Manage -> Disk Management), but this is not what I need. I need to be able to do this remotely via VBscript.

I am open to running an .exe from the VBscript and piping the output back into VBscript and massaging it from there.

Any idea's ? Thanks in advance.

A: 

I am not sure what you mean, but I think I have an idea. Have you checked out the the WMI class Win32_LogicalDisktoPartition. Check this out from a command prompt with admin privileges.

wmic path win32_logicaldisktopartition get /?

That will give you the class properties and methods. If you just run this, it will dump all the instances available.

wmic path win32_logicaldisktopartition

This might give you what you need. For Windows XP, this only seems to mention the disk with the boot partition. On Vista and newer, it seems to list everything, including optical disk. Problem is I have always found this info to be unhelpful unless you know what Disk0, Disk1, Disk(N) is, and that is rare beyond a specific computer to computer case. If it is useful, this is easy to put into a WMI call with VBScript. Hope it helps.

alharaka