To get the Environment info like Compsec, PAth, pathext windows folder and temporary folder location we can do like this
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
WScript.Echo "COMSPEC (Executable file for the command prompt ) : " &_
WshSysEnv("COMSPEC")
WScript.Echo "PATH : " & WshSysEnv("PATH")
WScript.Echo "PATHEXT : " & WshSysEnv("PATHEXT")
WScript.Echo "WINDIR : " & WshSysEnv("WINDIR")
WScript.Echo "TEMP : " & WshSysEnv("TEMP")
Filed under:
WSH/Wscript

Leave a comment