Make cmd.exe usable as startup shell

svn path=/trunk/; revision=4054
This commit is contained in:
Gé van Geldorp 2003-01-23 00:15:10 +00:00
parent 24ed00435b
commit cd5b2167bd

View file

@ -1,4 +1,4 @@
/* $Id: cmd.c,v 1.32 2002/11/11 21:53:25 hbirr Exp $ /* $Id: cmd.c,v 1.33 2003/01/23 00:15:10 gvg Exp $
* *
* CMD.C - command-line interface. * CMD.C - command-line interface.
* *
@ -915,6 +915,7 @@ static VOID
Initialize (int argc, char *argv[]) Initialize (int argc, char *argv[])
{ {
TCHAR commandline[CMDLINE_LENGTH]; TCHAR commandline[CMDLINE_LENGTH];
TCHAR ModuleName[_MAX_PATH + 1];
INT i; INT i;
#ifdef _DEBUG #ifdef _DEBUG
@ -1032,9 +1033,6 @@ Initialize (int argc, char *argv[])
} }
} }
ShortVersion ();
ShowCommands ();
/* run cmdstart.bat */ /* run cmdstart.bat */
if (IsValidFileName (_T("cmdstart.bat"))) if (IsValidFileName (_T("cmdstart.bat")))
{ {
@ -1074,10 +1072,11 @@ Initialize (int argc, char *argv[])
#endif #endif
/* Set COMSPEC environment variable */ /* Set COMSPEC environment variable */
#ifndef __REACTOS__ if (0 != GetModuleFileName (NULL, ModuleName, _MAX_PATH + 1))
if (argv) {
SetEnvironmentVariable (_T("COMSPEC"), argv[0]); ModuleName[_MAX_PATH] = _T('\0');
#endif SetEnvironmentVariable (_T("COMSPEC"), ModuleName);
}
/* add ctrl break handler */ /* add ctrl break handler */
AddBreakHandler (); AddBreakHandler ();
@ -1151,6 +1150,7 @@ int main (int argc, char *argv[])
SetFileApisToOEM(); SetFileApisToOEM();
AllocConsole();
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &Info) == FALSE) if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &Info) == FALSE)
{ {
fprintf(stderr, "GetConsoleScreenBufferInfo: Error: %ld\n", GetLastError()); fprintf(stderr, "GetConsoleScreenBufferInfo: Error: %ld\n", GetLastError());