Pass Password to runas from Python [duplicate]
问题 This question already has answers here : Using python to open cmd and automatically enter a password (3 answers) Closed 2 years ago . I need to run a file as another user without it prompting for a password, from my script. How is this done? 回答1: There's an executable program called SANUR.EXE that's made for just this kind of situation: you can use it to pipe in the password on the command-line, like this: runas /user:domain\username cmd.exe | sanur mysekritpassword . 回答2: Have the user add