Jump to content

Recommended Posts

Posted

I am trying to create a script that will read a registry key;

HKLM,"SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot","Path"

Then take the value of "Path" and install files to that location. I have researched using INF but cannot get it to work. So I really need help finding a way to accomplish this whether it be VB, WSH, CMD etc I am not picky :)


Posted

How about this, VBscript

Set WshShell = WScript.CreateObject("WScript.Shell")
strInstallPath="HKLM\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot\Path"

strFound=WshShell.RegRead(strInstallPath)
msgbox strFound

Posted
How about this, VBscript

Set WshShell = WScript.CreateObject("WScript.Shell")
strInstallPath="HKLM\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot\Path"

strFound=WshShell.RegRead(strInstallPath)
msgbox strFound

Thanks Iceman that was enough to get me started :)

Here is the finished code is someone else needs to do something similar;

Set fso = CreateObject("Scripting.FileSystemObject")

Set WshShell = WScript.CreateObject("WScript.Shell")

strInstallPath="HKLM\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot\Path"

strFound=WshShell.RegRead(strInstallPath)

fso.copyfile "EPSIMP32.FLT", strFound,TRUE

fso.copyfile "*.LOCAL", strFound,TRUE

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...