From 610ec85471b2a3bd65fb2ca1f0fc62735b3ccc12 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Thu, 7 Jul 2005 19:16:46 +0000 Subject: [PATCH] adding %cmdcmdline%, example how to use it echo %CMDCMDLINE% svn path=/trunk/; revision=16494 --- reactos/subsys/system/cmd/cmd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/reactos/subsys/system/cmd/cmd.c b/reactos/subsys/system/cmd/cmd.c index 450e38d28a8..9cca6e9188b 100644 --- a/reactos/subsys/system/cmd/cmd.c +++ b/reactos/subsys/system/cmd/cmd.c @@ -1028,6 +1028,15 @@ ProcessInput (BOOL bFlag) cp = _stpcpy (cp, szRand); } + /* %CMDCMDLINE% */ + else if (_tcsicmp(ip,_T("cmdcmdline")) ==0) + { + TCHAR *pargv; + /* Get random number */ + pargv = GetCommandLine(); + cp = _stpcpy (cp, pargv); + } + /* %ERRORLEVEL% */ else if (_tcsicmp(ip,_T("errorlevel")) ==0) @@ -1493,6 +1502,7 @@ int main (int argc, char *argv[]) argv = CommandLineToArgvW(GetCommandLineW(), &argc); #endif #endif + SetFileApisToOEM(); InputCodePage= 0; @@ -1512,16 +1522,18 @@ int main (int argc, char *argv[]) InputCodePage= GetConsoleCP(); OutputCodePage = GetConsoleOutputCP(); CMD_ModuleHandle = GetModuleHandle(NULL); - + /* check switches on command-line */ Initialize(argc, argv); /* call prompt routine */ nExitCode = ProcessInput(FALSE); + /* do the cleanup */ Cleanup(argc, argv); + return(nExitCode); }