Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Systemdrive

Status
Not open for further replies.

twooly

MIS
Feb 22, 2004
122
0
0
US
Can someone help me on how to get the systemdrive variable on a win2k box? I know how to do it on win2k3 using the win32_operatingsystem just can't get it figured out for a win2k box.
 
What about this ?
Code:
Set WshShell = CreateObject("WScript.Shell")
WScript.Echo "SystemDrive is " & WshShell.ExpandEnvironmentStrings("%SystemDrive%")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry should have said I need to figure out what it is remotely.
 
You can get it too using wmi binding to the remote's win32_operatingsystem and selecting it's systemdrive attribute. (In case systemdrive is not supported on the remote system, you can always fall back on systemdirectory attribute to derive the system drive from it.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top