Jump to content

Enable a Security Policy To Focus Window


sg4rb0spare

Recommended Posts

I have created a workaround to fix a problem that can occur on a Windows PC when UAC pops up, and your focus doesn't follow with the UAC window.  For example, when I try to start an elevated powershell, using the windows "run" box, and typing "powershell Start-Process cmd -Verb runAs"; the UAC box pops up for your to click no or yes however the focus is on the shell behind the pop-up box. 

In order to fix this, you have to "enable" a security policy.  To do this, run secpol.msc from the run prompt.  Then go to { Security Settings > Local Policies > User Account Control: Switch to the secure desktop when prompting for elevantion }, and click for it to be enabled.

 

Currently, I do this using the ducky script below.  However, what I'd like to do, is see if there is a shorter way of changing this setting.  Also I'd like to know if there is a way I can just set the policy to be enabled, because currently if the setting is already enabled, this script will change the setting to disabled.  So there is my problem, please help me fix it.

REM change sec policy on window focus
DELAY 1000
GUI r
DELAY 100
STRING secpol.msc
ENTER
DELAY 2500
SHIFT DOWNARROW
SHIFT DOWNARROW
SHIFT RIGHTARROW
SHIFT DOWNARROW
SHIFT DOWNARROW
SHIFT DOWNARROW
DELAY 700
SHIFT TAB
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT UPARROW
ENTER
DELAY 500
SHIFT UPARROW
ENTER
DELAY 500
ALT F
STRING X

Link to comment
Share on other sites

It would be great if you told us for what Windows version you're doing this. For example, on my Windows 8.1 installation, the UAC window is the focussed window.

Also, secpol.msc only works for ultimate and pro versions and not for home editions. And...are you sure this action doesn't trigger UAC itself? Doesn't ALT-TAB move the focus to the UAC window?

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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