readmedottxt Posted September 15, 2009 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
jvanegmond Posted September 15, 2009 Posted September 15, 2009 Works for me: #RequireAdmin Run("gpedit.msc", "", @SW_HIDE) github.com/jvanegmond
readmedottxt Posted September 16, 2009 Author Posted September 16, 2009 On 9/15/2009 at 8:23 AM, 'Manadar said: 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?
jvanegmond Posted September 16, 2009 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
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