Create Elevated Shortcut without UAC prompt in Windows 10  

Page 21 of 21 FirstFirst ... 11192021

  1. Posts : 4
    Windows 10 Enterprise 2016 LTSB
       #200

    Brink said:
    I'm glad it could help, but Matthew Wai wrote the BAT to help.
    Thanks @Matthew Wai

    By the way, is there a way to cd /d to current directory after running cmd.exe?

    Thank you
      My Computer

  2. Matthew Wai's Avatar
    Posts : 6,424
    Windows 10 Home 20H2
       #201

    You may manually copy the shortcut from the desktop into the current directory.
    Or do you mean the application is in the current directory?
      My Computer


  3. Posts : 4
    Windows 10 Enterprise 2016 LTSB
       #202

    Matthew Wai said:
    You may manually copy the shortcut from the desktop into the current directory.
    Or do you mean the application is in the current directory?
    Sorry, the context is I am using this bat script to run cmd as admin, and paring the output shortcut to this context menu .reg hack.

    While it works and it opens cmd, it does not change to current directory. It just points to path (i.e., system32).

    I have to
    Code:
    cd /d foo/bar
    each time to change the directory. I was just wondering if there is anything else I can do to have it point to the current directory as it runs the cmd shortcut or something...

    Thanks,
    Welp

    Edit: added context, and I guess this is was I was trying to get at
      My Computer

  4. Paul Black's Avatar
    Posts : 15,097
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #203

    Hello @whalp,

    whalp said:
    I have to . . .
    Code:
    cd /d foo/bar
    . . . each time to change the directory. Is there something I can change so that when it runs the generated shortcut, it opens cmd as admin and also changes directory to current directory?

    Have a look at this . . .

    > How to Add "Open Command Window Here as Administrator" Context Menu in Windows 10

    Also, have a look at the Related Tutorials at the BOTTOM of the above Tutorial [ there are a few ], as they may also be useful.

    I hope this helps.
      My Computer


  5. Posts : 4
    Windows 10 Enterprise 2016 LTSB
       #204

    Paul Black said:
    Wow, you are fast. Yea, I just saw that! Thanks for pointing me there.

    Though, I wonder if you can still use this batch method to achieve the same thing. I see that the task does
    Code:
    /c start "OpenCmdHereAsAdminNoUAC" "%windir%\System32\cmd.exe"
    . Is it possible to change directory to the current directory?
    Something like:
    Code:
    start "OpenCmdHereAsAdminNoUAC" "%windir%\System32\cmd.exe" /k cd /d "%currentDirectory%"
    Thanks
      My Computer


 
Page 21 of 21 FirstFirst ... 11192021

Tutorial Categories

Create Elevated Shortcut without UAC prompt in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  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 18:23.
Find Us




Windows 10 Forums