Re: 'rar' is not recognized as an internal or external command£¿£¿£¿£¿
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: 'rar' is not recognized as an internal or external command£¿£¿£¿£¿

From: Dejan Rodiger <dejan.wirusrodiger@ck.t-com.hr>
Date: Thu Feb 23 2006 - 11:53:56 CET

Ê÷Éϲä»Ò said the following on 23.02.2006 10:03:
> rar_cmd = r'"D:\Program Files\WinRAR\rar.exe" a -idcdp %s %s' % (target,' '.join(source))

You can't cd to d:\Program Files\WinRAR and then call rar

You have to call rar with full path.

from subprocess import *
retcode = call([r'"D:\Program Files\WinRAR\rar.exe"', 'a', '-idcdp', target,
' '.join(source)])
if retcode == 0:
        print "everything OK"

-- 
Dejan Rodiger - PGP ID 0xAC8722DC
Delete wirus from e-mail address
Received on Sun Apr 30 10:04:29 2006