Loading ...
Sorry, an error occurred while loading the content.
 

[Clip] Re: DOS Working directory

Expand Messages
  • Lawrence R. Thomas
    Hi Aron ... and seem ignorant of the ChDir command previously issued. Instead, they seem to be working in the AppPath directory. ... for future DOS commands
    Message 1 of 1 , Mar 25, 1999
      Hi Aron

      At 12:26 AM 3/26/1999 -0000, you wrote:
      >Hi gang -
      >
      >I'm writing a script that calls several DOS programs in succession. The
      idea is to:
      >
      >* Change the working directory (i.e. "cd s:\blah\blah")
      >* Run some programs that use the current directory for input/output
      >
      >I've done:
      >^!ChDir s:\blah\blah
      >^!DosCommand1 -options <parameters> etc.
      >^!DosCommand2 -etc.
      >
      >The problem is that the DosCommand1 and 2 are run in their own DOS box,
      and seem ignorant of the ChDir command previously issued. Instead, they
      seem to be working in the AppPath directory.
      >
      >Is there any way to set the DOS working directory and have it carry over
      for future DOS commands run via "^!"?
      >
      >I've combed the clip section of the helpfile, and I guess I'm just not
      seeing it. Thanks for any help you might be able to provide.
      >
      >Aaron

      ^!Chdir only works for some programs that need to start in their home
      directory to access configureation and ini files but it does not affect the
      current working directory itself. You need to use a batch file for that.

      Try the following clip instead.

      ---------< start clip >---------
      H="DOS COMMANDS"

      ;This is one long line.

      ^!TextToFile "^$GetAppPath$Doscmds.bat" @echo off^%nl%cd
      D:\DirPath^%nl%DosCommand1 -options <parameters> etc.^%nl%DosCommand2 -etc.

      ;This is the second shorter line.

      ^!RUN ^$GetAppPath$Doscmds.bat
      ---------< end clip >-----------

      The first line creates the batch file and the second line runs it. End
      each line in the batch file with ^%nl% which is the pre-defined variable
      for a cr/lf. You cannot use ^!DOS to run the batch file unless you want
      the DOS window to close as soon as the batch file is executed which can
      terminate some DOS programs before they get started. If you need a full
      DOS screen and get a DOS box or vice versa, press Alt+Enter to switch
      between them.

      Regards,

      Larry
      larryt@...

      ------------------------------------------------------------------------
      eGroup home: http://www.eGroups.com/list/ntb-clips
      Free Web-based e-mail groups by eGroups.com
    Your message has been successfully submitted and would be delivered to recipients shortly.