def run(args): """run program [args] Starts the specified program on the remote device. """ prog_args = [] for arg in args: if " " in arg: prog_args.append('"' + arg + '"') else: prog_args.append(arg) prog_args = string.join(prog_args, " ") wincerapi.CeCreateProcess(prog_args, "", None, None, 0, 0, None, "", None)
def DemoCreateProcess(): try: hp, ht, pid, tid = wincerapi.CeCreateProcess("Windows\\Python.exe", "", None, None, 0, 0, None, "", None) # Not necessary, except to see if handle closing raises an exception # (if auto-closed, the error is suppressed) hp.Close() ht.Close() print "Python is running on the remote device!" except win32api.error, (hr, fn, msg): print "Couldnt execute remote process -", msg