DOS Command Line replacement

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
TonyMc
Posts: 8
Joined: Sat Apr 16, 2005 6:51 pm
Location: Birmingham

DOS Command Line replacement

Post by TonyMc »

Hi,

I use JP Software's 4NT as my command shell in place of the built-in CMD.EXE whenever I can. Is there any way to make 4NT the command processor for the Tools|DOS Command Line... and Tools|DOS Shell menu options? If not, is there any chance of adding this as an option?

Cheers,
Tony
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Zeus uses the COMSPEC environment variable to determine the command processor, so you should be able to set this variable to point to any alternative command interpreter.

For example here is the code Zeus uses this get the command line interpreter from this variable:

Code: Select all

  //-- look for the environment variable
  char *pszComspec = getenv("COMSPEC");

  if (pszComspec)
  {
    //-- use the commanf line processor found
    szComspec = pszComspec;
  }
  else
  {
    //-- use the NT or windows command line processor
    szComspec = (IsNT()) ? "cmd.exe" : "command.com";
  }
Then when Zeus runs any pszCommandLine command line it builds up a command line as follows:

Code: Select all

  //-- get the command processor (ie the code above)
  GetComspec(szCommandLine);

  //-- add the "/c = kill session when complete" option
  szCommandLine += " /c ";

  //-- add in the remaining command line to be run
  szCommandLine += pszCommandLine;

  //-- run the command line
  return this->run(szCommandLine);
Also when Zeus opens a command line shell it does the following:

Code: Select all

bool Spawn::shell()
{
  String szCommandLine;

  //-- get the command processor (ie the code above)
  GetComspec(szCommandLine);

  //-- add the "/k = keep session open" option to the command line
  szCommandLine += " /k";

  //-- open the shell
  return this->run(szCommandLine);
}
Cheers Jussi
Post Reply