Microsoft® Windows® Script Host WshShell Object |
WSH Reference Version 1 |
Starts a new process, creates shortcuts, and provides the Environment collection to handle environmental variables such as WINDIR, PATH, or PROMPT.
The following example returns environment variable values using the Echo method:Set WshShell = WScript.CreateObject( "WScript.Shell" ) WScript.Echo WshShell.Environment.Item("WINDIR") WScript.Echo WshShell.Environment.Item("PATH") WScript.Echo WshShell.Environment.Item("PROMPT") WScript.Echo WshShell.ExpandEnvironmentStrings("%WINDIR%")