Path Problem on W2K?

Duncan Booth duncan at NOSPAMrcp.co.uk
Tue Aug 19 15:20:52 CEST 2003


Peter Hansen <peter at engcorp.com> wrote in 
news:3F41FECA.6743B6BD at engcorp.com:

>> Alternatively create doskey macros for commands like that then you just
>> need one file with a load of macro definitions.
> 
> Does that let you execute them from other batch files?  I
> have a few dozen utilities which run Python scripts by executing
> "call python scriptname.py" somewhere, relying on a .bat file
> in the PATH.  Does the DOSKEY approach work similarly?

No, DOSKEY just affects what you type, you would have to write the commands 
out in full in a batch file.

If you are running a lot of Python scripts from the command prompt or batch 
files, consider adding .py to the PATHEXT environment variable, that will 
let you run scripts directly, e.g. "scriptname" instead of "python 
scriptname.py", and will search PATH for the scripts. (However be aware 
that redirecting doesn't work on most versions of windows for scripts 
invoked this way!)

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?




More information about the Python-list mailing list