it will work, if i add this manually to the registry
Code:
powershell.exe -WindowStyle Hidden -NoProfile -Command "Start-Process -Verb RunAs cmd.exe -ArgumentList \"/k \"\"%1\"\"\"
but it doesnt, when i run it from a .reg file like this. The Key will not get added to the registry. I guess, its because wrong formation of the string. What do i need to change?
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\OpenCmdHereAsAdmin]
@="Open command window here as administrator"
"Extended"=-
"HasLUAShield"=""
"Icon"="imageres.dll,-5323"
[HKEY_CLASSES_ROOT\*\shell\OpenCmdHereAsAdmin\command]
@="powershell.exe -WindowStyle Hidden -NoProfile -Command "Start-Process -Verb RunAs cmd.exe -ArgumentList \"/k \"\"%1\"\"\"
Edit: This will work
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\OpenCmdHereAsAdmin]
@="Open command window here as administrator"
"Extended"=-
"HasLUAShield"=""
"Icon"="imageres.dll,-5323"
[HKEY_CLASSES_ROOT\*\shell\OpenCmdHereAsAdmin\command]
@="powershell.exe -WindowStyle Hidden -NoProfile -Command \"Start-Process -Verb RunAs cmd.exe -ArgumentList \\\"/k \\\"\\\"%1\\\"\\\"\\\""