How to format HKEY_CLASSES_ROOT shell entries to execute a scheduled task from the right-click context...

Why don't hotels mount air conditioning units outside the rooms?

Is there any risk in sharing info about technologies and products we use with a supplier?

Play Zip, Zap, Zop

How to make ice magic work from a scientific point of view?

Do theoretical physics suggest that gravity is the exchange of gravitons or deformation/bending of spacetime?

How can my powered armor quickly replace its ceramic plates?

Why is Agricola named as such?

A curious equality of integrals involving the prime counting function?

What does it mean for a caliber to be flat shooting?

Non-Cancer terminal illness that can affect young (age 10-13) girls?

How to read 火日参拾月参

What is the difference between rolling more dice versus fewer dice?

SET NOCOUNT Error in handling SQL call after upgrade

When can a QA tester start his job?

Is boss over stepping boundary/micromanaging?

How should I handle players who ignore the session zero agreement?

Why avoid shared user accounts?

What is the purpose of easy combat scenarios that don't need resource expenditure?

Is it a fallacy if someone claims they need an explanation for every word of your argument to the point where they don't understand common terms?

What would be the rarity of this magic item(s)?

Making him into a bully (how to show mild violence)

If I delete my router's history can my ISP still provide it to my parents?

What are "industrial chops"?

Positioning node within rectangle Tikz



How to format HKEY_CLASSES_ROOT shell entries to execute a scheduled task from the right-click context menu?


Which special variables are available when writing a shell command for a context menuCan I add a Windows Explorer context menu option to start command prompt in the selected directory?Run as admin cmd opens some common files locationElevate cmd to admin with command prompt?How to run determine current directory as parameter and pass to script activated from context menuHow do I shift the execution of a batch file from one CMD to another CMD?Powershell Start-Process -CredentialHow to execute a context menu command from PowerShell?How to open `cmd.exe` maximized from the explorer context menu?Elelevated local admin Runas (or Start-Process -verb Runas) within profile of other user domain user. Is it possible?













0















I'm going to preface this with that I am relatively new to registry tweaking, but please bear with me.





Today I was messing with my Windows 10 (home, version 1803) and after some googling I did 2 things:



I did some registry tweaks/additions to add the "Open CMD here as administrator" option to right click context menu.
This worked perfectly and here are the registry changes/additions I made:





HKEY_CLASSES_ROOTDirectoryshellOpenElevatedCmd:



(Default) = Open command prompt here as administrator
Icon = cmd.exe



HKEY_CLASSES_ROOTDirectoryshellOpenElevatedCmdcommand:



(Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenElevatedCmd:



(Default) = Open command prompt here as administrator



Icon = cmd.exe



HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenElevatedCmdcommand:



(Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



HKEY_CLASSES_ROOTDriveshellOpenElevatedCmd:



(Default) = Open command prompt here as administrator



Icon = cmd.exe



HKEY_CLASSES_ROOTDriveshellOpenElevatedCmdcommand:



(Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



HKEY_CLASSES_ROOTLibraryFolderbackgroundshellOpenElevatedCmd:



(Default) = Open command prompt here as administrator



Icon = cmd.exe



HKEY_CLASSES_ROOTLibraryFolderbackgroundshellOpenElevatedCmdcommand:



(Default) = (value not Set)





The second thing I did was use task scheduler to make a task that runs admin command prompt without the stupid UAC popup and
made a shortcut to it to pin to my taskbar. This worked perfectly as expected. Here is the task I made:



Elevated CMD Scheduled Task General



Elevated CMD Scheduled Task Action



The shortcut target to run this task is: C:WindowsSystem32schtasks.exe /run /tn "Elevated CMD"





It all went downhill when I attempted to freeball it and do something I couldn't find on google.



I thought it would be a good idea to make it so that when I launched the admin command prompt from the context menu in any
folder the UAC prompt would not appear. My first thought was to use some sort of method to make the admin command prompt not
require the UAC popup, so I did some googling and the only non-third-party method I could find was the one using the
"Application Compatibility Toolkit". I tried that method and it didn't work so my next thought was to combine the scheduled task
trick with the registry edits that add the "run cmd here as admin" context option. To do this I needed to figure out
what to put for the new values in the "command" defaults. So I took the arguments from the working values that added the
admin cmd to the context menu(/s /k pushd %V), and I tested them using a command I based off of the working registry values
in PowerShell to see if they did what I thought they did:



"Start-Process cmd.exe '/s /k pushd %V'"



This resulted in a new administrator command prompt being opened with a message "the system cannot find
the path specified." I assumed this was what should have happened based on how I think those arguments work.



Then I created a new scheduled task called "ecmd" that was identical to my "Elevated CMD" task that launches admin cmd without
the annoying UAC prompt, but this time I added the arguments "/s /k pushd %V" to the "Add arguments (optional):" field.
I then tested the following in PowerShell:



"Start-Process schtasks.exe '/run /tn ecmd'"



The new arguments "/run /tn ecmd" are the same arguments I used to launch this task with a shortcut.
This command worked exactly how I expected, It opened a new admin command prompt without the UAC popup with the same "cannot
find specified path" message as my earlier test.



At this point I thought I was good to go, so I changed:



"PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs""



to:



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



In all relevant locations, substituting cmd for schtasks and substituting the original arguments with the arguments that would make
task scheduler run the "ecmd" task...



This is where I became completely lost. All that happens when I open the right-click context menu and select "Open command prompt
here as administrator" is I get a brief flash of a command window and nothing else.



I have tried these commands as well:



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb Open""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd'""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,"ecmd"' -Verb RunAs""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,'ecmd'' -Verb RunAs""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn"ecmd"' -Verb RunAs""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn'ecmd'' -Verb RunAs""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn "ecmd"' -Verb RunAs""



"PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn 'ecmd'' -Verb RunAs""



All of which produce the same results or some of theme will open a UAC prompt about running task scheduler, and the prompt will list schtasks.exe
with the arguments I used "/run" "/tn" and "ecmd" as the location.



I am completely out of ideas and would love to know how to format these commands to make this work. I'm not knowledgeable enough to confidently assert this but I also feel like being able to execute a task with 2 clicks from anywhere in explorer/desktop/library will have a lot of utility in the future when new needs arise.









share







New contributor




BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I'm going to preface this with that I am relatively new to registry tweaking, but please bear with me.





    Today I was messing with my Windows 10 (home, version 1803) and after some googling I did 2 things:



    I did some registry tweaks/additions to add the "Open CMD here as administrator" option to right click context menu.
    This worked perfectly and here are the registry changes/additions I made:





    HKEY_CLASSES_ROOTDirectoryshellOpenElevatedCmd:



    (Default) = Open command prompt here as administrator
    Icon = cmd.exe



    HKEY_CLASSES_ROOTDirectoryshellOpenElevatedCmdcommand:



    (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



    HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenElevatedCmd:



    (Default) = Open command prompt here as administrator



    Icon = cmd.exe



    HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenElevatedCmdcommand:



    (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



    HKEY_CLASSES_ROOTDriveshellOpenElevatedCmd:



    (Default) = Open command prompt here as administrator



    Icon = cmd.exe



    HKEY_CLASSES_ROOTDriveshellOpenElevatedCmdcommand:



    (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



    HKEY_CLASSES_ROOTLibraryFolderbackgroundshellOpenElevatedCmd:



    (Default) = Open command prompt here as administrator



    Icon = cmd.exe



    HKEY_CLASSES_ROOTLibraryFolderbackgroundshellOpenElevatedCmdcommand:



    (Default) = (value not Set)





    The second thing I did was use task scheduler to make a task that runs admin command prompt without the stupid UAC popup and
    made a shortcut to it to pin to my taskbar. This worked perfectly as expected. Here is the task I made:



    Elevated CMD Scheduled Task General



    Elevated CMD Scheduled Task Action



    The shortcut target to run this task is: C:WindowsSystem32schtasks.exe /run /tn "Elevated CMD"





    It all went downhill when I attempted to freeball it and do something I couldn't find on google.



    I thought it would be a good idea to make it so that when I launched the admin command prompt from the context menu in any
    folder the UAC prompt would not appear. My first thought was to use some sort of method to make the admin command prompt not
    require the UAC popup, so I did some googling and the only non-third-party method I could find was the one using the
    "Application Compatibility Toolkit". I tried that method and it didn't work so my next thought was to combine the scheduled task
    trick with the registry edits that add the "run cmd here as admin" context option. To do this I needed to figure out
    what to put for the new values in the "command" defaults. So I took the arguments from the working values that added the
    admin cmd to the context menu(/s /k pushd %V), and I tested them using a command I based off of the working registry values
    in PowerShell to see if they did what I thought they did:



    "Start-Process cmd.exe '/s /k pushd %V'"



    This resulted in a new administrator command prompt being opened with a message "the system cannot find
    the path specified." I assumed this was what should have happened based on how I think those arguments work.



    Then I created a new scheduled task called "ecmd" that was identical to my "Elevated CMD" task that launches admin cmd without
    the annoying UAC prompt, but this time I added the arguments "/s /k pushd %V" to the "Add arguments (optional):" field.
    I then tested the following in PowerShell:



    "Start-Process schtasks.exe '/run /tn ecmd'"



    The new arguments "/run /tn ecmd" are the same arguments I used to launch this task with a shortcut.
    This command worked exactly how I expected, It opened a new admin command prompt without the UAC popup with the same "cannot
    find specified path" message as my earlier test.



    At this point I thought I was good to go, so I changed:



    "PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs""



    to:



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



    In all relevant locations, substituting cmd for schtasks and substituting the original arguments with the arguments that would make
    task scheduler run the "ecmd" task...



    This is where I became completely lost. All that happens when I open the right-click context menu and select "Open command prompt
    here as administrator" is I get a brief flash of a command window and nothing else.



    I have tried these commands as well:



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb Open""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd'""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,"ecmd"' -Verb RunAs""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,'ecmd'' -Verb RunAs""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn"ecmd"' -Verb RunAs""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn'ecmd'' -Verb RunAs""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn "ecmd"' -Verb RunAs""



    "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn 'ecmd'' -Verb RunAs""



    All of which produce the same results or some of theme will open a UAC prompt about running task scheduler, and the prompt will list schtasks.exe
    with the arguments I used "/run" "/tn" and "ecmd" as the location.



    I am completely out of ideas and would love to know how to format these commands to make this work. I'm not knowledgeable enough to confidently assert this but I also feel like being able to execute a task with 2 clicks from anywhere in explorer/desktop/library will have a lot of utility in the future when new needs arise.









    share







    New contributor




    BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0


      1






      I'm going to preface this with that I am relatively new to registry tweaking, but please bear with me.





      Today I was messing with my Windows 10 (home, version 1803) and after some googling I did 2 things:



      I did some registry tweaks/additions to add the "Open CMD here as administrator" option to right click context menu.
      This worked perfectly and here are the registry changes/additions I made:





      HKEY_CLASSES_ROOTDirectoryshellOpenElevatedCmd:



      (Default) = Open command prompt here as administrator
      Icon = cmd.exe



      HKEY_CLASSES_ROOTDirectoryshellOpenElevatedCmdcommand:



      (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



      HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenElevatedCmd:



      (Default) = Open command prompt here as administrator



      Icon = cmd.exe



      HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenElevatedCmdcommand:



      (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



      HKEY_CLASSES_ROOTDriveshellOpenElevatedCmd:



      (Default) = Open command prompt here as administrator



      Icon = cmd.exe



      HKEY_CLASSES_ROOTDriveshellOpenElevatedCmdcommand:



      (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



      HKEY_CLASSES_ROOTLibraryFolderbackgroundshellOpenElevatedCmd:



      (Default) = Open command prompt here as administrator



      Icon = cmd.exe



      HKEY_CLASSES_ROOTLibraryFolderbackgroundshellOpenElevatedCmdcommand:



      (Default) = (value not Set)





      The second thing I did was use task scheduler to make a task that runs admin command prompt without the stupid UAC popup and
      made a shortcut to it to pin to my taskbar. This worked perfectly as expected. Here is the task I made:



      Elevated CMD Scheduled Task General



      Elevated CMD Scheduled Task Action



      The shortcut target to run this task is: C:WindowsSystem32schtasks.exe /run /tn "Elevated CMD"





      It all went downhill when I attempted to freeball it and do something I couldn't find on google.



      I thought it would be a good idea to make it so that when I launched the admin command prompt from the context menu in any
      folder the UAC prompt would not appear. My first thought was to use some sort of method to make the admin command prompt not
      require the UAC popup, so I did some googling and the only non-third-party method I could find was the one using the
      "Application Compatibility Toolkit". I tried that method and it didn't work so my next thought was to combine the scheduled task
      trick with the registry edits that add the "run cmd here as admin" context option. To do this I needed to figure out
      what to put for the new values in the "command" defaults. So I took the arguments from the working values that added the
      admin cmd to the context menu(/s /k pushd %V), and I tested them using a command I based off of the working registry values
      in PowerShell to see if they did what I thought they did:



      "Start-Process cmd.exe '/s /k pushd %V'"



      This resulted in a new administrator command prompt being opened with a message "the system cannot find
      the path specified." I assumed this was what should have happened based on how I think those arguments work.



      Then I created a new scheduled task called "ecmd" that was identical to my "Elevated CMD" task that launches admin cmd without
      the annoying UAC prompt, but this time I added the arguments "/s /k pushd %V" to the "Add arguments (optional):" field.
      I then tested the following in PowerShell:



      "Start-Process schtasks.exe '/run /tn ecmd'"



      The new arguments "/run /tn ecmd" are the same arguments I used to launch this task with a shortcut.
      This command worked exactly how I expected, It opened a new admin command prompt without the UAC popup with the same "cannot
      find specified path" message as my earlier test.



      At this point I thought I was good to go, so I changed:



      "PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs""



      to:



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



      In all relevant locations, substituting cmd for schtasks and substituting the original arguments with the arguments that would make
      task scheduler run the "ecmd" task...



      This is where I became completely lost. All that happens when I open the right-click context menu and select "Open command prompt
      here as administrator" is I get a brief flash of a command window and nothing else.



      I have tried these commands as well:



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb Open""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd'""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,"ecmd"' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,'ecmd'' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn"ecmd"' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn'ecmd'' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn "ecmd"' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn 'ecmd'' -Verb RunAs""



      All of which produce the same results or some of theme will open a UAC prompt about running task scheduler, and the prompt will list schtasks.exe
      with the arguments I used "/run" "/tn" and "ecmd" as the location.



      I am completely out of ideas and would love to know how to format these commands to make this work. I'm not knowledgeable enough to confidently assert this but I also feel like being able to execute a task with 2 clicks from anywhere in explorer/desktop/library will have a lot of utility in the future when new needs arise.









      share







      New contributor




      BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I'm going to preface this with that I am relatively new to registry tweaking, but please bear with me.





      Today I was messing with my Windows 10 (home, version 1803) and after some googling I did 2 things:



      I did some registry tweaks/additions to add the "Open CMD here as administrator" option to right click context menu.
      This worked perfectly and here are the registry changes/additions I made:





      HKEY_CLASSES_ROOTDirectoryshellOpenElevatedCmd:



      (Default) = Open command prompt here as administrator
      Icon = cmd.exe



      HKEY_CLASSES_ROOTDirectoryshellOpenElevatedCmdcommand:



      (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



      HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenElevatedCmd:



      (Default) = Open command prompt here as administrator



      Icon = cmd.exe



      HKEY_CLASSES_ROOTDirectoryBackgroundshellOpenElevatedCmdcommand:



      (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



      HKEY_CLASSES_ROOTDriveshellOpenElevatedCmd:



      (Default) = Open command prompt here as administrator



      Icon = cmd.exe



      HKEY_CLASSES_ROOTDriveshellOpenElevatedCmdcommand:



      (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"



      HKEY_CLASSES_ROOTLibraryFolderbackgroundshellOpenElevatedCmd:



      (Default) = Open command prompt here as administrator



      Icon = cmd.exe



      HKEY_CLASSES_ROOTLibraryFolderbackgroundshellOpenElevatedCmdcommand:



      (Default) = (value not Set)





      The second thing I did was use task scheduler to make a task that runs admin command prompt without the stupid UAC popup and
      made a shortcut to it to pin to my taskbar. This worked perfectly as expected. Here is the task I made:



      Elevated CMD Scheduled Task General



      Elevated CMD Scheduled Task Action



      The shortcut target to run this task is: C:WindowsSystem32schtasks.exe /run /tn "Elevated CMD"





      It all went downhill when I attempted to freeball it and do something I couldn't find on google.



      I thought it would be a good idea to make it so that when I launched the admin command prompt from the context menu in any
      folder the UAC prompt would not appear. My first thought was to use some sort of method to make the admin command prompt not
      require the UAC popup, so I did some googling and the only non-third-party method I could find was the one using the
      "Application Compatibility Toolkit". I tried that method and it didn't work so my next thought was to combine the scheduled task
      trick with the registry edits that add the "run cmd here as admin" context option. To do this I needed to figure out
      what to put for the new values in the "command" defaults. So I took the arguments from the working values that added the
      admin cmd to the context menu(/s /k pushd %V), and I tested them using a command I based off of the working registry values
      in PowerShell to see if they did what I thought they did:



      "Start-Process cmd.exe '/s /k pushd %V'"



      This resulted in a new administrator command prompt being opened with a message "the system cannot find
      the path specified." I assumed this was what should have happened based on how I think those arguments work.



      Then I created a new scheduled task called "ecmd" that was identical to my "Elevated CMD" task that launches admin cmd without
      the annoying UAC prompt, but this time I added the arguments "/s /k pushd %V" to the "Add arguments (optional):" field.
      I then tested the following in PowerShell:



      "Start-Process schtasks.exe '/run /tn ecmd'"



      The new arguments "/run /tn ecmd" are the same arguments I used to launch this task with a shortcut.
      This command worked exactly how I expected, It opened a new admin command prompt without the UAC popup with the same "cannot
      find specified path" message as my earlier test.



      At this point I thought I was good to go, so I changed:



      "PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs""



      to:



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



      In all relevant locations, substituting cmd for schtasks and substituting the original arguments with the arguments that would make
      task scheduler run the "ecmd" task...



      This is where I became completely lost. All that happens when I open the right-click context menu and select "Open command prompt
      here as administrator" is I get a brief flash of a command window and nothing else.



      I have tried these commands as well:



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb Open""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd'""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,"ecmd"' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,'ecmd'' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn"ecmd"' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn'ecmd'' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn "ecmd"' -Verb RunAs""



      "PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn 'ecmd'' -Verb RunAs""



      All of which produce the same results or some of theme will open a UAC prompt about running task scheduler, and the prompt will list schtasks.exe
      with the arguments I used "/run" "/tn" and "ecmd" as the location.



      I am completely out of ideas and would love to know how to format these commands to make this work. I'm not knowledgeable enough to confidently assert this but I also feel like being able to execute a task with 2 clicks from anywhere in explorer/desktop/library will have a lot of utility in the future when new needs arise.







      command-line powershell windows-registry context-menu windows-task-scheduler





      share







      New contributor




      BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 mins ago









      BattleSnacksBattleSnacks

      1




      1




      New contributor




      BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      BattleSnacks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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
          });


          }
          });






          BattleSnacks is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1410091%2fhow-to-format-hkey-classes-root-shell-entries-to-execute-a-scheduled-task-from-t%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          BattleSnacks is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          BattleSnacks is a new contributor. Be nice, and check out our Code of Conduct.













          BattleSnacks is a new contributor. Be nice, and check out our Code of Conduct.












          BattleSnacks is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • 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%2fsuperuser.com%2fquestions%2f1410091%2fhow-to-format-hkey-classes-root-shell-entries-to-execute-a-scheduled-task-from-t%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

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...