I have a script which needs to run a command on command line with admin privileges.
password = "abcdef"
cmd = ['runas', '/user:', 'cmd.exe /C echo test']
cmd[1]+=str(platform.node())
subprocess.Popen(cmd)
I can have the code get to ask for password(admin password), but is there a way I can supply password without it asking me again and again as there a quiet a number of times I need to call command line