Real'sHowTo AddThis Feed Button
Custom Search

Get the "Program Files" pathTag(s): WSH VBScript


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

blog comments powered by Disqus


If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2013
[ home ]