emmanuelbeaudet
Programmer
Want to know if there is a function or something in vbscript who can give me the sys root of the computer. Whatever if it is c:\, m:\ or anything else.
Thank you.
Thank you.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
set wshshell=createobject("wscript.shell")
sWinDir=wshshell.ExpandEnvironmentStrings("%WinDir%")
set fso=createobject("scripting.filesystemobject")
sysDrv= fso.GetDriveName(sWinDir)
set fso=nothing
set wshshell=nothing
wscript.echo sysDrv & vbcrlf & ShowRootFolder(sysDrv)
'From documentation
Function ShowRootFolder(drvspec)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetDrive(drvspec)
ShowRootFolder = f.RootFolder
End Function