[fpc-pascal]Re: chdir problem? -- 2nd request

James_Wilson at i2.com James_Wilson at i2.com
Mon Jan 15 15:08:59 CET 2001

> Hmmm.. if you make your program launch a new CMD.EXE
> just before it exits (after changing path) - that new
> "command promt" should point to the desired directory?!?

I use the following function
     exec (getenv ('COMSPEC'),concat (' /C ',Command,' "',FileName,'"'));

Command is whatever was requested from the command line -- attrib, del,
view, etc. -- while FileName is... well you should know what that one
means.  :-)

Since this program can be used on DOS, Win9x, NT or 2000 I can't
specifically say cmd.exe for the command interpreter, but what I'm doing
above should probably be enough (well, on everything but NT and 2000 it is


More information about the fpc-pascal mailing list