I'd like to add an action on Context menu when right-clicking on a Directory in the Windows File Explorer.
This works:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\test\command]
@=""C:\Python311\pythonw.exe" "D:\test\test.py" "%1""
[HKEY_CLASSES_ROOT\Directory\Background\shell\test\command]
@=""C:\Python311\pythonw.exe" "D:\test\test.py" "%v""
but how to make it start as administrator instead?
I've tried:
runas /user:administrator ...without success because I don't use a password for current user, and it seems to require a password@="powershell -WindowStyle Hidden -Command \"Start-Process 'C:\\Python311\\pythonw.exe' -ArgumentList 'D:\\test\\test.py','%1' -Verb runAs\""but this shows a PowerShell window for a few seconds which I don't wantadding
HasLUAShieldregistry entrythere seem to be options with a VBS launcher but I'd like to avoid another language like VBS
without any success.
I cannot make it work, is it maybe linked to this: 1809 update broke "run as administrator" from context menus only on desktop and start menu?
Which trick do all tools that get started as admin, from context menu? I think it should be common.
NB: it works if we explicitely name it runas:
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="test"
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=""C:\Python311\pythonw.exe" "D:\test\test.py" "%1""
but then this means that we would not be able do it for a second context menu action, because there is just one runas, see Multiple context menu run as administrator through registry editor.
