Retrieve Windows System Variables
By nater

Set oShell = CreateObject("WScript.Shell")
Set oProcEnv = oShell.Environment("PROCESS")

sProgramFiles = oProcEnv("ProgramFiles")

If sProgramFiles = "" Then
sProgramFiles = oShell.RegRead _
("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir")
End If

WScript.Echo sProgramFiles

Rating:


0/5 based on 0 votes. The median rating is 0.

Submitted: 11/19/10 (Edited 11/19/10)

Description: This VB script example will retrieve a specific windows variables, in particular the program files directory.

Tags:

Views: 135 views. Averaging 0 views per day.
In the most recent 30 day period, there've been 0 views.

Similar Articles:
VBS To set enviroment variables
Retrieve Computer Name, OS Version, Servic
Display windows hotfixes
Hollywood May Need to Rethink Release Windows to C
Hollywood May Need to Rethink Release Windows to C

Previous Article | Next Article