Jump to content

problem with "reg add" for RunOnceEx-key


Recommended Posts

Hi!

I use the following code to add a registry key to RunOnceEx.

REG ADD %KEY%\001 /V 1 /D "setup.exe /K:1234" /f

But because of the colon (":") after the letter "K" this is condemned to fail. :( Why? In this case reg add only adds the stuff after the colon, everything in front of it is utterly ignored. :wacko:

Is there any way to make this work regardless of the colon? thx a lot!

Link to comment
Share on other sites


SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY%\001 /VE /D "Setup" /f
REG ADD %KEY%\001 /V 1 /D "setup.exe /K:1234" /f

This is what i tested with. Run it and checked the runonceex key. It is there.

Link to comment
Share on other sites

I've tested it for you and got the same result as MHz got.

If it's not working for you this way, you can import it via a reg file like this one:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\001]
@="Setup"
"1"="setup.exe /K:1234"

Link to comment
Share on other sites

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...