frostbite1000 Posted September 23, 2005 Posted September 23, 2005 Hey Guys, I need a Visual Basic Script that can Edit the registry. I want to add a program to the startup list from a script. If someone could write that for me that would be great [With an example program of where the real one should go] Thanks
gunsmokingman Posted September 23, 2005 Posted September 23, 2005 Hey Guys, I need a Visual Basic Script that can Edit the registry. I want to add a program to the startup list from a script. If someone could write that for me that would be great [With an example program of where the real one should go] Thanks <{POST_SNAPBACK}>This place a short cut in the all user start up menu it set to opennotepadOption ExplicitDim Act, Scut, WD, All_UP : Set Act=CreateObject("Wscript.Shell")ALL_UP = Act.ExpandEnvironmentStrings("%AllUsersProfile%") : WD = Act.ExpandEnvironmentStrings("%windir%")Set Scut = Act.CreateShortcut(ALL_UP & "\Start Menu\Programs\Startup\SCNotepad.lnk")Scut.TargetPath = WD & "\Notepad.exe"Scut.WorkingDirectory = WDScut.Save
Yzöwl Posted September 24, 2005 Posted September 24, 2005 If you are wanting to add to the Run section of the registry, then something like this perhaps:Const constHKEY_LOCAL_MACHINE = &H80000002Const constComputer = "."Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ constComputer & "\root\default:StdRegProv")strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"strValueName = "MyVal"strValue = "Drive:\PathTo\MyFile.ext"objReg.SetStringValue constHKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValueYou would simply need to change the strings 'strValueName' and 'strValue' to your specific needs
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