WinSCP launched by script running as admin, but should not run as admin: "RunAsInvoker" not working?

Advertisement

Ccyz7
Joined:
Posts:
2

WinSCP launched by script running as admin, but should not run as admin: "RunAsInvoker" not working?

Hi,
I have a setup in which WinSCP is launched by a script running as admin (I have no other option for out-of-topic reasons).

However, I do NOT want WinSCP to run as admin (because if so, I can't drag and drop files from Windows Explorer, and I miss this).

The common solution for this is to do a registry key:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
D:\software\WinSCP-Portable\WinSCP.exe = RunAsInvoker
But this seems ignored and I still can't drag and drop files from files Explorer windows.

How to solve this?

Thank you in advance! :)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
42,081
Location:
Prague, Czechia

Re: WinSCP launched by script running as admin, but should not run as admin: "RunAsInvoker" not working?

I do not think that RunAsInvoker does what you want.
What it does is that when the app is marked to request Administrator privileges on start, it does not grant them.
But it does not relinquish Administrator privileges if the calling process already has them.
And WinSCP is not marked to request Administrator privileges anyway.

This is not really a WinSCP question, but possible solutions are (in general):
  • If the intended account does not have administrator privileges, explicitly run WinSCP with that account:
    runas /user:StandardUsername "WinSCP.exe"
  • Run WinSCP via ad hoc temporary task scheduler task without Administrator privileges.
  • Run WinSCP via explorer process:
    explorer WinSCP.exe

Reply with quote

Advertisement

You can post new topics in this forum