python subprocess as different user in windows

1.6k views Asked by At

I have written the post commit hook in python. In my python script i need to call the application by using another user account. Because post commit hook running as empty environment not a user specific.

Is anyway to call application as specific user in subprocess ?

Note that i have used windows amchine.

Thanks in advance.

1

There are 1 answers

0
user931563 On

You can use the runas command to run an application as another user if the pywin32 package is not available in your environment (similar to sudo on *nix).