Is there a way to move arrow key to left on Windows Popup?












0















I am writing a script which will allow PowerShell to run in admin mode but when I run Set-ExecutionPolicy Bypass, Windows displays a popup and I use my left arrow key to move to the yes button and press enter.



The problem I am facing is that it does not move to the left or press enter when I run the script as follows.



RunWait PowerShell.exe -ExecutionPolicy Bypass -NoExit -Command "C:Users%A_UserName%DesktopScript.ps1";
Send {Left}
Sleep, 5000
Send {Enter}


I am expecting it to actually move to the OK button on the left and press enter but nothing actually happens.










share|improve this question



























    0















    I am writing a script which will allow PowerShell to run in admin mode but when I run Set-ExecutionPolicy Bypass, Windows displays a popup and I use my left arrow key to move to the yes button and press enter.



    The problem I am facing is that it does not move to the left or press enter when I run the script as follows.



    RunWait PowerShell.exe -ExecutionPolicy Bypass -NoExit -Command "C:Users%A_UserName%DesktopScript.ps1";
    Send {Left}
    Sleep, 5000
    Send {Enter}


    I am expecting it to actually move to the OK button on the left and press enter but nothing actually happens.










    share|improve this question

























      0












      0








      0








      I am writing a script which will allow PowerShell to run in admin mode but when I run Set-ExecutionPolicy Bypass, Windows displays a popup and I use my left arrow key to move to the yes button and press enter.



      The problem I am facing is that it does not move to the left or press enter when I run the script as follows.



      RunWait PowerShell.exe -ExecutionPolicy Bypass -NoExit -Command "C:Users%A_UserName%DesktopScript.ps1";
      Send {Left}
      Sleep, 5000
      Send {Enter}


      I am expecting it to actually move to the OK button on the left and press enter but nothing actually happens.










      share|improve this question














      I am writing a script which will allow PowerShell to run in admin mode but when I run Set-ExecutionPolicy Bypass, Windows displays a popup and I use my left arrow key to move to the yes button and press enter.



      The problem I am facing is that it does not move to the left or press enter when I run the script as follows.



      RunWait PowerShell.exe -ExecutionPolicy Bypass -NoExit -Command "C:Users%A_UserName%DesktopScript.ps1";
      Send {Left}
      Sleep, 5000
      Send {Enter}


      I am expecting it to actually move to the OK button on the left and press enter but nothing actually happens.







      autohotkey






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 3 at 3:34









      Singha22Singha22

      32




      32
























          1 Answer
          1






          active

          oldest

          votes


















          1















          • If you run PowerShell in admin mode your script needs also to be run
            in this mode.

          • Unlike Run, RunWait will wait until the program (in
            this case PowerShell.exe) finishes before continuing (= sending
            commands to the popup window). To bypass this problem use SetTimer.






          share|improve this answer
























          • Thanks for the help. I figured out a solution to my problem by running the .ahk in Admin Mode and it worked like a gem. Thanks though!

            – Singha22
            Jan 4 at 1:20











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016007%2fis-there-a-way-to-move-arrow-key-to-left-on-windows-popup%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1















          • If you run PowerShell in admin mode your script needs also to be run
            in this mode.

          • Unlike Run, RunWait will wait until the program (in
            this case PowerShell.exe) finishes before continuing (= sending
            commands to the popup window). To bypass this problem use SetTimer.






          share|improve this answer
























          • Thanks for the help. I figured out a solution to my problem by running the .ahk in Admin Mode and it worked like a gem. Thanks though!

            – Singha22
            Jan 4 at 1:20
















          1















          • If you run PowerShell in admin mode your script needs also to be run
            in this mode.

          • Unlike Run, RunWait will wait until the program (in
            this case PowerShell.exe) finishes before continuing (= sending
            commands to the popup window). To bypass this problem use SetTimer.






          share|improve this answer
























          • Thanks for the help. I figured out a solution to my problem by running the .ahk in Admin Mode and it worked like a gem. Thanks though!

            – Singha22
            Jan 4 at 1:20














          1












          1








          1








          • If you run PowerShell in admin mode your script needs also to be run
            in this mode.

          • Unlike Run, RunWait will wait until the program (in
            this case PowerShell.exe) finishes before continuing (= sending
            commands to the popup window). To bypass this problem use SetTimer.






          share|improve this answer














          • If you run PowerShell in admin mode your script needs also to be run
            in this mode.

          • Unlike Run, RunWait will wait until the program (in
            this case PowerShell.exe) finishes before continuing (= sending
            commands to the popup window). To bypass this problem use SetTimer.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 at 9:43









          user3419297user3419297

          5,1022714




          5,1022714













          • Thanks for the help. I figured out a solution to my problem by running the .ahk in Admin Mode and it worked like a gem. Thanks though!

            – Singha22
            Jan 4 at 1:20



















          • Thanks for the help. I figured out a solution to my problem by running the .ahk in Admin Mode and it worked like a gem. Thanks though!

            – Singha22
            Jan 4 at 1:20

















          Thanks for the help. I figured out a solution to my problem by running the .ahk in Admin Mode and it worked like a gem. Thanks though!

          – Singha22
          Jan 4 at 1:20





          Thanks for the help. I figured out a solution to my problem by running the .ahk in Admin Mode and it worked like a gem. Thanks though!

          – Singha22
          Jan 4 at 1:20




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016007%2fis-there-a-way-to-move-arrow-key-to-left-on-windows-popup%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Mossoró

          Error while reading .h5 file using the rhdf5 package in R

          Pushsharp Apns notification error: 'InvalidToken'