Create Elevated Shortcut without UAC prompt in Windows 10  

Page 13 of 25 FirstFirst ... 3111213141523 ... LastLast

  1. Posts : 66,488
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #120

    Hello @phrab,

    What happens when you right click on the .bat file, and click/tap on Edit instead?

    Does it open it in Notepad to view?
      My Computers


  2. Posts : 926
    windows 10 professional 64-bit, 22H2
       #121

    Brink said:
    Hello @phrab,

    What happens when you right click on the .bat file, and click/tap on Edit instead?

    Does it open it in Notepad to view?
    Yes. It's not that the bat file doesn't run (& I did use it to create a shortcut to a game, just to test, & it worked). It's that when I click the resultant desktop shortcut, I get the message that Windows can't open this type of file. I expected it to create a new text file in Notepad.
      My Computers


  3. Posts : 66,488
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #122

    phrab said:
    Yes. It's not that the bat file doesn't run (& I did use it to create a shortcut to a game, just to test, & it worked). It's that when I click the resultant desktop shortcut, I get the message that Windows can't open this type of file. I expected it to create a new text file in Notepad.
    Are you having issues opening just this shortcut (lnk) file, or all shortcuts?

    I don't think you will be able to open this shortcut with Notepad though.
      My Computers


  4. Posts : 926
    windows 10 professional 64-bit, 22H2
       #123

    Brink said:
    Are you having issues opening just this shortcut (lnk) file, or all shortcuts?

    I don't think you will be able to open this shortcut with Notepad though.
    All my .lnk shorcuts work, as far as I know. It's just the Notepad.exe & Metapad.exe that I've tested, to see if it would work. I expected the desktop shortcut (the one created with the bat file) to act as if I clicked on either of those executables.
      My Computers


  5. Posts : 66,488
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #124

    phrab said:
    All my .lnk shorcuts work, as far as I know. It's just the Notepad.exe & Metapad.exe that I've tested, to see if it would work. I expected the desktop shortcut (the one created with the bat file) to act as if I clicked on either of those executables.
    I have noticed that this may not always work for games due to how they may run.

    You might give option 2 a try to see how it does, and if the elevated shortcut will work or not.
      My Computers


  6. Posts : 926
    windows 10 professional 64-bit, 22H2
       #125

    Brink said:
    I have noticed that this may not always work for games due to how they may run.

    You might give option 2 a try to see how it does, and if the elevated shortcut will work or not.
    Thank you. I actually don't need to use this method to run Notepad or Metapad. I just wanted to test to see if I understood it & could make it work. It actually did work on a game. If I open cmd or powershell & type notepad.exe or C:\Utilities\Metapad metapad.exe, they open new text files. So I figured this bat file would crate a desktop shortcut that would do the same.
      My Computers


  7. Posts : 7,599
    Windows 10 Home 20H2
       #126

    phrab said:
    Create_an_elevated_shortcut.bat doesn't work, doesn't create anything, just flashes
    phrab said:
    I tried to test Create_an_elevated_shortcut.bat by choosing it to open Notepad. Also, if Metapad.exe (a notepad alternative) is chosen, there's a message that Windows can't open this type of file, the same message I get when choosing Notepad.

    Should this happen?
    This has not happened at my end.
    Click here to download the latest version of Create_an_elevated_shortcut.bat.
    The shortcut shown in the following screenshot works properly. Metapad.exe will be run successfully. Windows can open it.

    Create Elevated Shortcut without UAC prompt in Windows 10-shortcut-metapad.jpg

    phrab said:
    It actually did work on a game.
    Do you mean the .bat script worked on a game but did not work on Notepad and Metapad?
      My Computer


  8. Posts : 7,599
    Windows 10 Home 20H2
       #127

    phrab said:
    when I click the resultant desktop shortcut, I get the message that Windows can't open this type of file.
    phrab said:
    If I open cmd or powershell & type notepad.exe or C:\Utilities\Metapad metapad.exe, they open new text files.
    Go to Task Scheduler-->Task Scheduler Library-->Apps. Right-click on the "Metapad" task-->Properties-->Actions. Do you see the following?

    Create Elevated Shortcut without UAC prompt in Windows 10-scheduled-task.jpg

    In my case, the shortcut will actually Start a program "D:\Testing\metapad.exe"
    The command "D:\Testing\metapad.exe" works on Command Prompt.
      My Computer


  9. Posts : 926
    windows 10 professional 64-bit, 22H2
       #128

    Matthew Wai said:
    Go to Task Scheduler-->Task Scheduler Library-->Apps. Right-click on the "Metapad" task-->Properties-->Actions. Do you see the following?

    Create Elevated Shortcut without UAC prompt in Windows 10-scheduled-task.jpg

    In my case, the shortcut will actually Start a program "D:\Testing\metapad.exe"
    The command "D:\Testing\metapad.exe" works on Command Prompt.
    Hi Mathew:

    Thank you for responding. I downloaded your latest Create_an_elevated_shortcut.bat, from the link you provided. To answer your questions:
    1. First, I had been looking in the wrong place in the Task Scheduler for the task. I looked under "Task Scheduler Library" & didn't expand "Apps". I see now that I have created several tasks. See the image below. And, yes, I see a similar task action.
    Create Elevated Shortcut without UAC prompt in Windows 10-task-scheduler.png
    Create Elevated Shortcut without UAC prompt in Windows 10-metapad-actions.png



    2. When I click the resultant Metapad shortcut, I get the following message (see screenshot):
    Create Elevated Shortcut without UAC prompt in Windows 10-cant-open.png

    So it creates a shortcut on my desktop & creates a task in the Task Scheduler, which appears to have the correct action. However, when I click the shortcut, all it does is flash & then I get the screen above. When I press Escape, the screen goes away, but a new text file isn't created.

    This is what I have in my Utilities Folder for your utility:

    Create Elevated Shortcut without UAC prompt in Windows 10-create-folder.png

    3. When I used your .bat file to run a game (Bridge Buff 19), it did work; i.e. there was a flash & then the game opened. I'm just not sure why it doesn't open a new text file for Notepad or Metapad.

    - - - Updated - - -

    Matthew Wai said:
    Go to Task Scheduler-->Task Scheduler Library-->Apps. Right-click on the "Metapad" task-->Properties-->Actions. Do you see the following?

    Create Elevated Shortcut without UAC prompt in Windows 10-scheduled-task.jpg

    In my case, the shortcut will actually Start a program "D:\Testing\metapad.exe"
    The command "D:\Testing\metapad.exe" works on Command Prompt.
    I just found my error & I apologize for wasting everyone's time. I have a program called SendToToys. It has an option to send a file to the clipboard as a name. That's what I used for the path, each time I used your utility. I just noticed that it adds an extra space after the path. That's why I kept getting error messages. When I removed that space, everything worked fine!

    Again, I apologize to you & to @Brink.
      My Computers


  10. Posts : 66,488
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #129

    No need to apologize @phrab.

    I'm glad you found the culprit, and posted back to let us know so it may help others with the same issue.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:16.
Find Us




Windows 10 Forums