On Fri, Sep 22, 2023 at 9:42 AM Christian Franke via Cygwin <cygwin@cygwin.com> wrote: > > Martin Wege via Cygwin wrote: > > Hello, > > > > Does Cygwin have a tool to run a bash script as SYSTEM user if my > > account already have admin rights? > > No (AFAIK). > > I use psexec from Sysinternals tools > (https://learn.microsoft.com/sysinternals/downloads/psexec) > > This starts a Cygwin terminal as SYSTEM user: > > psexec -s -i c:\cygwin\bin\mintty -
Use of psexec is forbidden, as it triggers our security software (Cortex XDR). Windows has https://learn.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-impersonateloggedonuser Can we use that to write a C wrapper program, to switch from current user with admin rights to the SYSTEM account, execute command and then exit(0) the wrapper? Thanks, Martin -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple