Changeset 14251e4 in superlime


Ignore:
Timestamp:
Jan 28, 2015 7:44:36 PM (5 years ago)
Author:
azubr <github@…>
Branches:
master
Children:
720eb59
Parents:
ca1ddb7
Message:

Fix for separate admin user on Windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Superlime.py

    r2efa40e r14251e4  
    6464                if os.name == "nt": 
    6565                        command = 'copy /y `\\"%s`\\" `\\"%s`\\"' % (source, target) 
    66                         runasCommand = 'start-process \\"$env:windir\system32\cmd.exe\\" \\"/c,%s\\" -verb RunAs -Wait -WindowStyle Hidden -WorkingDirectory $env:windir' % command 
     66                        runasCommand = '$proc = start-process \\"$env:windir\system32\cmd.exe\\" \\"/c,%s\\" -verb RunAs -WindowStyle Hidden -WorkingDirectory $env:windir -Passthru; do {start-sleep -Milliseconds 100} until ($proc.HasExited)' % command 
    6767                        psCommand = 'powershell -command "%s"' % runasCommand 
    68                         os.popen(psCommand) 
     68                        subprocess.call(psCommand, shell=True) 
    6969                if os.name == "posix": 
    7070                        trySudo = lambda sudo: subprocess.call('%s dd if=%s of=%s' % (sudo, source, target), shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT) 
Note: See TracChangeset for help on using the changeset viewer.