Problem with and windows schtasks

Prasad, Ramit ramit.prasad at
Fri Nov 23 23:32:48 CET 2012

Dave Angel wrote:
> On 11/20/2012 06:41 PM, Tom Borkin wrote:
> (Please don't top-post.  Now we lose all the context)
> > Using shlex, I now have this:
> > #!\Python27\python
> > import os, subprocess
> > path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2",
> > "htdocs", "ccc", "")
> >['SchTasks', '/Create', '/SC', 'ONCE', '/TN', '"test"',
> > '/TR', path, '/ST', '23:50'])
> >['SchTasks', '/Create', '/SC', 'ONCE', '/TN', '"test"',
> > '/TR', '', '/ST', '23:50'])
> > Both of the above commands throw the same error:
> > ERROR: The filename, directory name or volume label syntax is incorrect.
> I don't use Windows, but doesn't a Windows program usually have an .exe
> extension?  So why would you expect it to find SchTasks ?  Adding
> extensions is a shell feature, and you're not using the shell.
> Also, you should take a look at the value "path".  On Linux, it shows up as:
> C:\\/Program Files/Apache Group/Apache2/htdocs/ccc/
> It'll be different under Windows, but probably still wrong.

Windows 7 + Python 2.6
>>> os.path.join("C:\\", "Program Files", "Apache Group", "Apache2",
...  "htdocs", "ccc", "")
'C:\\Program Files\\Apache Group\\Apache2\\htdocs\\ccc\\'


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at  

More information about the Python-list mailing list