Jump to content

regedit /s works in .BAT but not in AutoIT?


Recommended Posts

FYI, as of windows 7, trying to make a registry entry that is initiated by anything other than the user clicking on a .bat or .reg file is difficult. Example, make a bat that launches REGEDIT /S and it will work. Now compile that bat to an exe (but change nothing in the script) and notice it will not work. Even if you make the exe call another .bat file which then calls REGEDIT /S...it still does not work.

Many people are having this problem, as it relates to the added security in windows 7.

Try "reg import [path to reg file]" instead of REGEDIT /S

If that don't work, try running the .reg file that is being launched from the %temp% directory.

Both of these are permissions friendly.

Link to comment
Share on other sites

icecom3 - thank you for posting. i have tried both and both have failed with the exact same issue... moving forward i am just going to execute it from a Batch file.

Run("reg import c:file.reg") <= failed

Run("reg import " & @TempDir & "file.reg") <= failed

Link to comment
Share on other sites

  • 6 months later...

I found that under Windows 7 64-bit:

run("regedit.exe /s C:Reg.reg") statement failed, but

run("reg.exe IMPORT C:Reg.reg") worked OK, and the registry keys were imported successfully (the user had rights to these areas)

When run manually from the command line, the first statement generates a User Account Control prompt, but the second one doesn't.

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
 Share

  • Recently Browsing   0 members

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