readmedottxt Posted September 15, 2009 Share Posted September 15, 2009 On a 2k3 DC, AutoIt 3.3.0.0, the following line launches mmc.exe hidden, as expected: ShellExecute("mmc.exe", "", "", "", @SW_HIDE) The following always brings mmc/gpedit into focus and doesn't hide it: ShellExecute("gpedit.msc", "", "", "", @SW_HIDE) ShellExecute("mmc.exe", "gpedit.msc", "", "", @SW_HIDE) I've tried using 'Run' as well, no cigar. Ideas or suggestions? TIA Link to comment Share on other sites More sharing options...
jvanegmond Posted September 15, 2009 Share Posted September 15, 2009 Works for me: #RequireAdmin Run("gpedit.msc", "", @SW_HIDE) github.com/jvanegmond Link to comment Share on other sites More sharing options...
readmedottxt Posted September 16, 2009 Author Share Posted September 16, 2009 Works for me: #RequireAdmin Run("gpedit.msc", "", @SW_HIDE) That doesn't work, I thought .msc files are loaded by mmc.exe therefore 'Run' will do nothing. My code was Run("mmc.exe gpedit.msc", "", @SW_HIDE) which will load in full view, not hidden. Just loading mmc.exe will load hidden. Did you try it on Server 2003? Any other tips? Link to comment Share on other sites More sharing options...
jvanegmond Posted September 16, 2009 Share Posted September 16, 2009 I tried it on Windows 7, where it works just fine. Just tried it on again on Windows Vista where it doesn't work. I've found that the run mechanism in Windows 7 changed quite a bit. As a workaround I can suggest this: #RequireAdmin ShellExecute("gpedit.msc") WinWait("Local Group Policy Editor") WinSetState("Local Group Policy Editor", "", @SW_HIDE) github.com/jvanegmond 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