![]() ![]() " 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'"" " 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"" Here as administrator" is I get a brief flash of a command window and nothing else. All that happens when I open the right-click context menu and select "Open command prompt In all relevant locations, substituting cmd for schtasks and substituting the original arguments with the arguments that would make " PowerShell -windowstyle hidden -Command "Start-Process schtasks.exe -ArgumentList '/run,/tn,ecmd' -Verb RunAs"" " PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs"" This command worked exactly how I expected, It opened a new admin command prompt without the UAC popup with the same "cannotįind specified path" message as my earlier test.Īt this point I thought I was good to go, so I changed: The new arguments "/run /tn ecmd" are the same arguments I used to launch this task with a shortcut. " Start-Process schtasks.exe '/run /tn ecmd'" I then tested the following in PowerShell: The annoying UAC prompt, but this time I added the arguments " /s /k pushd %V" to the "Add arguments (optional):" field. Then I created a new scheduled task called "ecmd" that was identical to my "Elevated CMD" task that launches admin cmd without The path specified." I assumed this was what should have happened based on how I think those arguments work. This resulted in a new administrator command prompt being opened with a message "the system cannot find " Start-Process cmd.exe '/s /k pushd %V'" In PowerShell to see if they did what I thought they did: So I took the arguments from the working values that added theĪdmin cmd to the context menu(/s /k pushd %V), and I tested them using a command I based off of the working registry values What to put for the new values in the "command" defaults. Trick with the registry edits that add the "run cmd here as admin" context option. I tried that method and it didn't work so my next thought was to combine the scheduled task Require the UAC popup, so I did some googling and the only non-third-party method I could find was the one using the My first thought was to use some sort of method to make the admin command prompt not 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įolder the UAC prompt would not appear. It all went downhill when I attempted to freeball it and do something I couldn't find on google. The shortcut target to run this task is: C:\Windows\System32\schtasks.exe /run /tn "Elevated CMD" ![]() Made a shortcut to it to pin to my taskbar. ![]() ![]() The second thing I did was use task scheduler to make a task that runs admin command prompt without the stupid UAC popup and HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd\command: HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd: HKEY_CLASSES_ROOT\Drive\shell\OpenElevatedCmd\command: HKEY_CLASSES_ROOT\Drive\shell\OpenElevatedCmd: HKEY_CLASSES_ROOT\Directory\Background\shell\OpenElevatedCmd\command: HKEY_CLASSES_ROOT\Directory\Background\shell\OpenElevatedCmd: (Default) = PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs" HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd\command: (Default) = Open command prompt here as administrator HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd: This worked perfectly and here are the registry changes/additions I made: I did some registry tweaks/additions to add the "Open CMD here as administrator" option to right click context menu. Today I was messing with my Windows 10 (home, version 1803) and after some googling I did 2 things: I'm going to preface this with that I am relatively new to registry tweaking, but please bear with me. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |