Page 1 of 1

DOS Command Line replacement

Posted: Fri Jul 22, 2005 1:17 pm
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

Posted: Sat Jul 23, 2005 3:56 am
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