Jump to content

Running a .reg file and .bat file


Recommended Posts

Look up Run() and ShellExecute()

Thanks for the quick response,

ShellExecute() worked like a charm, but run() didnt work. Here is what i got:

run("CFProdEnterprise.reg")
ShellExecute("3-CF_Prod_Trust.cmd")
Link to comment
Share on other sites

be careful with how you use them...read help file carefully. I think you want to use Run() with the .bat and ShellExecute() with the .reg, but I've never used ShellExecute with a reg file before. If you use Run() with the .bat, maybe you can use Run("REG IMPORT XXX.REG") or something like that. Experiment with it, I can't at the moment otherwise I would try.

Link to comment
Share on other sites

be careful with how you use them...read help file carefully. I think you want to use Run() with the .bat and ShellExecute() with the .reg, but I've never used ShellExecute with a reg file before. If you use Run() with the .bat, maybe you can use Run("REG IMPORT XXX.REG") or something like that. Experiment with it, I can't at the moment otherwise I would try.

Excellent it worked!!! Thanks foryour help!

Link to comment
Share on other sites

You're welcome, but keep in mind using this method doesn't guarantee it's going to work. Referring particularly to the Run() on the .reg file, there's no way to tell if it worked using this method unless you add some more code for checking it.

Link to comment
Share on other sites

Is there any reason you can't use RegWrite instead of .reg files?

You could completely rewrite the batch file in AutoIt too.

Good point... if you are the one writing the original reg file in the first place, using RegWrite would be the better way to go if you choose to use AutoIt for this.

Same with the batch file, if you're the original creator and you still want to use AutoIt then rewriting in AutoIt would be better.

Even better is if the batch and reg file are being using for the same task/job, just rewrite everything in AutoIt.

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