SHARE
TWEET

Untitled

a guest Apr 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import subprocess, ctypes, sys
  2.  
  3. # Make sure we run as admin
  4. def is_admin():
  5.     try:
  6.         return ctypes.windll.shell32.IsUserAnAdmin()
  7.     except:
  8.         return False
  9.  
  10. if is_admin():
  11.     # Disconnect anything on M
  12.     subprocess.call(r'net use m: /del', shell=True)
  13.  
  14.     # Connect to shared drive, use drive letter M
  15.     subprocess.call(r'net use m: \\10.0.15.40\support.private /user:ivaylo.marinov NNdredscott44', shell=True)
  16.  
  17.     # Run auto installer
  18.     subprocess.call(r'M:\test\vray4installer.exe -auto', shell=True)
  19.  
  20. else:
  21.     # Re-run the program with admin rights
  22.     ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top