Hyflex Posted March 16, 2015 Share Posted March 16, 2015 (edited) Hey Guys, I have a script that I run that requires a second part to be ran after you reboot... How best would I do this, the file that I want to run once after the next reboot is: INPReg.exe Obviously I could do:RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce', 'P REG', 'REG_SZ', 'C:\Folder\In\PReg.exe') Is there a specific way I should do it? Edited March 16, 2015 by Hyflex Link to comment Share on other sites More sharing options...
MilesAhead Posted March 16, 2015 Share Posted March 16, 2015 (edited) It looks ok to me except that you should test the return value for error. I'm not sure which type commands need HKLM or HKCU. I have utilities to select a file to Run or RunOnce. With Run I use HKCU with RunOnce HKLM. I suspect the RunOnce to HKLM might not register if the user is not part of the Administrator Group. But the way you are doing it with HKCU it shouldn't matter. Unless the command required some privilege. Edited March 27, 2015 by MilesAhead My Freeware Page 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