[IronPython] System.Diagnostics.Process.Start only uses first argument
Dino Viehland
dinov at exchange.microsoft.com
Fri Jun 22 17:32:44 CEST 2007
How exactly are you passing this? I assume the quotes aren't being included? The 1st form below prompts me and the 2nd form doesn't prompt (ignoring the UAC prompt on Vista of course which is a whole other ball of wax), are you doing something different?
>>> import System
>>> System.Diagnostics.Process.Start('regedit.exe', '"/s foo.reg"')
<System.Diagnostics.Process object at 0x000000000000002B [System.Diagnostics.Process (regedit)]>
>>> System.Diagnostics.Process.Start('regedit.exe', '/s foo.reg')
<System.Diagnostics.Process object at 0x000000000000002C [System.Diagnostics.Process (regedit)]>
You could also check out the nt module where we have nt.popen (or os if you have the CPython std lib installed) which takes a single command line (exe + args) and we do the splitting for you - that'd also be compatible w/ CPython.
-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luke Hoersten
Sent: Friday, June 22, 2007 8:07 AM
To: users at lists.ironpython.com
Subject: [IronPython] System.Diagnostics.Process.Start only uses first argument
System.Diagnostics.Process.Start(app, args) should take a string of
arguments delimited by spaces for the second argument of start which
it will pass to app on stdin. I'm trying to run app = "regedit.exe"
and args ="/s key.reg" but it's only recognizing the first argument
(which is /s). If I remove /s, it runs the key but I want this to run
silently.
I've also tried ProcessStartInfo() but it suffers from the same
problem. Does anyone have any more information on this or know how to
work around this?
Thanks,
Luke
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
More information about the Ironpython-users
mailing list