vglnT Posted October 27, 2010 Share Posted October 27, 2010 I am building an install package so I can distribute a program that I have developed during my internship. There is a registry key that contains a file path, and I would like to prepend something like this: "C:\blah\blah2;". I have tried just making a .reg file, but I do not believe that I can do what I want with this type of file. I think I may need some type of .bat file, which I have never messed with.Summary:I need a script that does this:key = [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Application]string value = getValue("StartUpPath")value = "C:\blah1\blah2;" + valuesetValue("StartUpPath",value)Thanks in advance for the help, because I am at a loss. Link to comment Share on other sites More sharing options...
IcemanND Posted October 28, 2010 Share Posted October 28, 2010 What are you using to create your install package? Link to comment Share on other sites More sharing options...
allen2 Posted October 28, 2010 Share Posted October 28, 2010 If you're looking for a script, you should look at autoit as it will handle this as you almost wrote it. Link to comment Share on other sites More sharing options...
Yzöwl Posted October 28, 2010 Share Posted October 28, 2010 @vglnT - We really do need you to reply to IcemanND's question.@allen2 - AutoIT's beauty is in its scripting of GUI stuff, I'd see it as overkill for a simple task doable with built-in tools.When I say built-in I mean either to the software which builds the installation package, (InstallShield for instance has this feature), or to script it separately using components already part of the end users Operating System. Link to comment Share on other sites More sharing options...
turborider Posted January 8, 2011 Share Posted January 8, 2011 vbs script solution----------------------------------------------------------------------------------------------------------------------------const HKEY_CURRENT_USER = &H80000001strComputer = "."Set StdOut = WScript.StdOutSet objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv")strKeyPath = "Software\Microsoft\Office\11.0\Application"strValueName = "StartUpPath1"objReg.GetExpandedStringValue HKEY_CURRENT_USER,strKeyPath,_strValueName,strValuestrValue1 = "C:\blah1\blah2;" & strValue objReg.SetExpandedStringValue HKEY_CURRENT_USER,strKeyPath,_strValueName,strValue1---------------------------------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now