none
Getting current directory for shortcut running as admin RRS feed

  • Question

  • I have a shortcut to a batch script. Shortcut is running as admin.

    When I open the shortcut, it defaults to %systemroot%\system32

    Is it possible to:

    1) Have a shortcut to a batch file that opens as admin, but still defaults to current directory (directory from where I am running the shortcut)

    2) I need the shortcut to run the batch file with a relative path, in order to have a relative path, I need to get somehow current directory path.

    Tuesday, March 25, 2014 12:05 AM

Answers

All replies

  • YOU understand that this has nothing to do with  scripting. It is a user application usage issue.  It is a Windows 101 "How can I ....?"

    The simple answer is ... "set the start in folder in the shortcut"

    1.  Right click on shortcut.
    2.  Select properties.
    3.  Set "Start In" value to your desired starting folder.

    This is pretty much true of all things in Windows.  Set the properties of anything to get it to do what you want.


    ¯\_(ツ)_/¯


    • Edited by jrv Tuesday, March 25, 2014 12:26 AM
    Tuesday, March 25, 2014 12:25 AM
  • An elevated Windows process will always start in system32.

    Why is my starting directory ignored when I elevate a command prompt?


    -- Bill Stewart [Bill_Stewart]

    Tuesday, March 25, 2014 2:16 PM
    Moderator