[python-win32] python-win32 Digest, Vol 62, Issue 13

bob gailer bgailer at gmail.com
Thu May 15 13:53:01 CEST 2008


siddhartha veedaluru wrote:
> Hi,
>  
> Sorry about the confusing question.
>  
Thank you. This feels a LOT better. Now we can help.
> Here is what i want to achieve
>  
> i have certain updates that i need to install on different machines
> These updates are placed in a location and is mapped to all the machines
> There will be an exe file say "InstallUpdate.exe" for every update.
>  
> i need to run this exe on all the machines.
> i tried running the exe using the following code
> <code>
>  
> import wmi, os.path, time
> connection = wmi.connect_server (server="orcl", user="Administrator", 
> password="boss")
> c = wmi.WMI (wmi=connection)
> pid, result = c.Win32_Process.Create(r'cmd 
> /c Z:\update01\InstallUpdate.exe > C:\sid.txt')
> if result != 0:
>     print "Update installation failed"
> else:
>     print "Update installation Suceeded"
>  
> <code>

Why not just use subprocess.Popen?
>  
> Now i couldn't able to run InstallUpdate.exe as this is on Mapped drive.
> If i copy the same update to local drive on the remote machine and run 
> it, its installing.
>  
> 1) what should be added here inorder to run it from Mapped drive.
> 2) Also is there any way i get back the result of the command executed 
> or i can only redirect it to a file.
>  
> Thanks,
> Siddhartha
> ------------------------------------------------------------------------
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>   


-- 
Bob Gailer
919-636-4239 Chapel Hill, NC



More information about the python-win32 mailing list