Newbie - pass variable to cscript

Rhodri James rhodri at wildebst.demon.co.uk
Tue Mar 3 21:37:00 EST 2009


On Tue, 03 Mar 2009 15:22:20 -0000, <plsullivan1 at gmail.com> wrote:

> It's not firing off the vbs script. Have I got the syntax correct?
> Thanks.
>
> My latest attempt:
> vBS = "C:\\Program Files\\nasa\\nmail.vbs"
> os.system('cscript /from:wrk-gis at pittcountync.gov /
> to:plsullivan at pittcountync.gov /sub:TEST /msg:hello ' + vBS)

Your problem is that vBS has a space in it, so the Windows
command interpreter is interpreting it as two separate arguments,
r"C:\Program" and r"Files\nasa\nmail.vbs".

Gabriel has already posted two solutions (which I won't repeat),
but he forgot to mention the problem itself!

-- 
Rhodri James *-* Wildebeeste Herder to the Masses



More information about the Python-list mailing list