Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. fh = open("C:WindowsSystem32driversetchello.txt", "w")
  2. fh.write("new line")
  3. fh.close()
  4.  
  5. runas.exe /user:administrator "C:Python34python.exe myscript.py"
  6.  
  7. fh = open(r"C:WindowsSystem32driversetchello.txt", "a") # add, not overwrite
  8.  
  9. sudo python myscript.py
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement