Evergreen Posted July 24, 2008 Share Posted July 24, 2008 I have created an exe via AutoIT that basically copies some files and runs a .reg file. During the running of the .reg file two message boxes come up for which I use WinWaitActive and then pass an {enter}. I have created a "wrapper" to run the .exe as a domain admin. I would like to run the exe in silent mode so that the user will not se the two registry message boxes. Here is the runas line from my wrapper (DiskCleanUp.exe is the exe I created using AutoIT). RunAsWait($szRunAsUser, $szRunAsDom, $szRunAsPass, 1, $szInstallFilesSource & 'DiskCleanUp.exe') Thanks, Evergreen Link to comment Share on other sites More sharing options...
Paulie Posted July 24, 2008 Share Posted July 24, 2008 If you want to use Command lines, Autoit interprets that commands passed to it through the pre-defined $CMDLine array. Link to comment Share on other sites More sharing options...
James Posted July 24, 2008 Share Posted July 24, 2008 Switch StringUpper($CMDLine) Case "/DEBUG" MsgBox(0, "", "Debug Mode!") Case "/SILENT" Opt("TrayIconHide", 1) Case Else ConsoleWrite("What? & @CRLF) EndSwitch Little example. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 24, 2008 Share Posted July 24, 2008 The messages from the reg files are coming from regedit, not AutoIt. You have to modify the registry using Reg*() functions. Link to comment Share on other sites More sharing options...
ksmith247 Posted July 24, 2008 Share Posted July 24, 2008 Or call regedit /s somefile.reg to import the file into the registry silently. Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size] Link to comment Share on other sites More sharing options...
Evergreen Posted July 24, 2008 Author Share Posted July 24, 2008 Thank you all. I ended up going with Run("regedit.exe /s DiskCleanUp.reg", $szLocalTempDir) Thanks again, Evergreen 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