Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess, ctypes, sys
- # Make sure we run as admin
- def is_admin():
- try:
- return ctypes.windll.shell32.IsUserAnAdmin()
- except:
- return False
- if is_admin():
- # Disconnect anything on M
- subprocess.call(r'net use m: /del', shell=True)
- # Connect to shared drive, use drive letter M
- subprocess.call(r'net use m: \\10.0.15.40\support.private /user:ivaylo.marinov NNdredscott44', shell=True)
- # Run auto installer
- subprocess.call(r'M:\test\vray4installer.exe -auto', shell=True)
- else:
- # Re-run the program with admin rights
- ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement