diff --git a/reactos/subsys/system/cmd/En.rc b/reactos/subsys/system/cmd/En.rc index 73f51dad971..4759d3d90ee 100644 --- a/reactos/subsys/system/cmd/En.rc +++ b/reactos/subsys/system/cmd/En.rc @@ -289,6 +289,52 @@ STRING_MEMMORY_HELP2, "\n %12s%% memory load.\n\n \ %13s bytes total virtual memory.\n \ %13s bytes available virtual memory.\n" +STRING_MISC_HELP1, "Press a key to continue...\n" + +STRING_MOVE_HELP1, "Overwrite %s (Yes/No/All)? " + +STRING_MOVE_HELP2, "Moves files and renames files and directories.\n\n \ +To move one or more files:\n \ +MOVE [/N][drive:][path]filename1[,...] destination\n\n \ +To rename a directory:\n \ +MOVE [/N][drive:][path]dirname1 dirname2\n\n \ + [drive:][path]filename1 Specifies the location and name of the file\n \ + or files you want to move.\n \ + /N Nothing. Don everthing but move files or direcories.\n\n \ +Current limitations:\n \ + - You can't move a file or directory from one drive to another.\n" + + + +STRING_PROMPT_HELP1, "Changes the command prompt.\n\n \ +PROMPT [text]\n\n \ + text Specifies a new command prompt.\n\n \ +Prompt can be made up of normal characters and the following special codes:\n\n \ + $A & (Ampersand)\n \ + $B | (pipe)\n \ + $C ( (Left parenthesis)\n \ + $D Current date\n \ + $E Escape code (ASCII code 27)\n \ + $F ) (Right parenthesis)\n \ + $G > (greater-than sign)\n \ + $H Backspace (erases previous character)\n \ + $L < (less-than sign)\n \ + $N Current drive\n \ + $P Current drive and path\n \ + $Q = (equal sign)\n \ + $T Current time\n \ + $V OS version number\n \ + $_ Carriage return and linefeed\n \ + $$ $ (dollar sign)" + +STRING_PAUSE_HELP1, "Stops the execution of a batch file and shows the following message:\n \ +'Press any key to continue...' or a user defined message.\n\n \ +PAUSE [message]" + +STRING_PROMPT_HELP2, " $+ Displays the current depth of the directory stack" + +STRING_PROMPT_HELP3, "\nType PROMPT without parameters to reset the prompt to the default setting." + STRING_RMDIR_HELP, "Removes a directory.\n\n \ RMDIR [drive:]path\nRD [drive:]path" @@ -349,6 +395,9 @@ STRING_FREE_ERROR2, "unlabeled" STRING_GOTO_ERROR1, "No label specified for GOTO" STRING_GOTO_ERROR2, "Label '%s' not found\n" +STRING_MOVE_ERROR1, "[OK]\n" +STRING_MOVE_ERROR2, "[Error]\n" + STRING_PARAM_ERROR, "Required parameter missing\n" STRING_ERROR_PARAMETERF_ERROR, "Parameter format not correct - %c\n" diff --git a/reactos/subsys/system/cmd/misc.c b/reactos/subsys/system/cmd/misc.c index 36fca266977..860bb76254b 100644 --- a/reactos/subsys/system/cmd/misc.c +++ b/reactos/subsys/system/cmd/misc.c @@ -27,9 +27,13 @@ * * 06-Nov-1999 (Eric Kohl ) * Added PagePrompt() and FilePrompt(). + * + * 30-Apr-2005 (Magnus Olsen) ) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" /* @@ -434,8 +438,10 @@ HWND GetConsoleWindow (VOID) INT PagePrompt (VOID) { INPUT_RECORD ir; + WCHAR szMsg[RC_STRING_MAX_SIZE]; - ConOutPrintf (_T("Press a key to continue...\n")); + LoadString( GetModuleHandle(NULL), STRING_MISC_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf((LPTSTR)szMsg); RemoveBreakHandler (); ConInDisable (); @@ -464,6 +470,8 @@ INT FilePromptYN (LPTSTR szFormat, ...) { TCHAR szOut[512]; va_list arg_ptr; + WCHAR szMsg[RC_STRING_MAX_SIZE]; + // TCHAR cKey = 0; // LPTSTR szKeys = _T("yna"); @@ -484,10 +492,16 @@ INT FilePromptYN (LPTSTR szFormat, ...) for (p = szIn; _istspace (*p); p++) ; - if (*p == _T('Y')) - return PROMPT_YES; - else if (*p == _T('N')) - return PROMPT_NO; + LoadString( GetModuleHandle(NULL), STRING_CHOICE_OPTION, (LPTSTR) szMsg,sizeof(szMsg)); + + + + if (wcsncmp(((WCHAR*) p),&szMsg[0],1)==0) + return PROMPT_YES; + else if (wcsncmp(((WCHAR*) p),&szMsg[1],1)==0) + return PROMPT_NO; + + #if 0 else if (*p == _T('\03')) return PROMPT_BREAK; @@ -533,6 +547,8 @@ INT FilePromptYNA (LPTSTR szFormat, ...) va_list arg_ptr; // TCHAR cKey = 0; // LPTSTR szKeys = _T("yna"); + WCHAR szMsg[RC_STRING_MAX_SIZE]; + TCHAR szIn[10]; LPTSTR p; @@ -551,12 +567,16 @@ INT FilePromptYNA (LPTSTR szFormat, ...) for (p = szIn; _istspace (*p); p++) ; - if (*p == _T('Y')) - return PROMPT_YES; - else if (*p == _T('N')) - return PROMPT_NO; - if (*p == _T('A')) - return PROMPT_ALL; + LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, (LPTSTR) szMsg,sizeof(szMsg)); + + + if (wcsncmp(((WCHAR*) p),&szMsg[0],1)==0) + return PROMPT_YES; + else if (wcsncmp(((WCHAR*) p),&szMsg[1],1)==0) + return PROMPT_NO; + else if (wcsncmp( ((WCHAR*) p),&szMsg[2],1)==0) + return PROMPT_ALL; + #if 0 else if (*p == _T('\03')) return PROMPT_BREAK; diff --git a/reactos/subsys/system/cmd/move.c b/reactos/subsys/system/cmd/move.c index 926194e13d5..987d6332821 100644 --- a/reactos/subsys/system/cmd/move.c +++ b/reactos/subsys/system/cmd/move.c @@ -20,9 +20,13 @@ * * 03-Feb-1999 (Eric Kohl ) * Added "/N" option. + * + * 30-Apr-2005 (Magnus Olsen) ) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_MOVE @@ -37,8 +41,10 @@ static INT Overwrite (LPTSTR fn) { TCHAR inp[10]; LPTSTR p; + WCHAR szMsg[RC_STRING_MAX_SIZE]; - ConOutPrintf (_T("Overwrite %s (Yes/No/All)? "), fn); + LoadString( GetModuleHandle(NULL), STRING_MOVE_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg, fn); ConInString (inp, 10); _tcsupr (inp); @@ -67,6 +73,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param) HANDLE hFile; LPTSTR pszFile; BOOL bNothing = FALSE; + WCHAR szMsg[RC_STRING_MAX_SIZE]; if (!_tcsncmp (param, _T("/?"), 2)) { @@ -85,20 +92,8 @@ INT cmd_move (LPTSTR cmd, LPTSTR param) " /-Y\n" "...")); #else - ConOutPuts (_T("Moves files and renames files and directories.\n\n" - "To move one or more files:\n" - "MOVE [/N][drive:][path]filename1[,...] destination\n" - "\n" - "To rename a directory:\n" - "MOVE [/N][drive:][path]dirname1 dirname2\n" - "\n" - " [drive:][path]filename1 Specifies the location and name of the file\n" - " or files you want to move.\n" - " /N Nothing. Don everthing but move files or direcories.\n" - "\n" - "Current limitations:\n" - " - You can't move a file or directory from one drive to another.\n" - )); + LoadString( GetModuleHandle(NULL), STRING_MOVE_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); #endif return 0; } @@ -106,6 +101,8 @@ INT cmd_move (LPTSTR cmd, LPTSTR param) arg = split (param, &argc, FALSE); nFiles = argc; + LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, (LPTSTR) szMsg,sizeof(szMsg)); + /* read options */ for (i = 0; i < argc; i++) { @@ -117,14 +114,14 @@ INT cmd_move (LPTSTR cmd, LPTSTR param) if (*p == _T('-')) { p++; - if (_totupper (*p) == _T('Y')) + if ((WCHAR*) _totupper (*p) == &szMsg[0]) bPrompt = TRUE; } else { - if (_totupper (*p) == _T('Y')) + if ((WCHAR*) _totupper (*p) == &szMsg[0]) bPrompt = FALSE; - else if (_totupper (*p) == _T('N')) + else if ((WCHAR*) _totupper (*p) == &szMsg[1]) bNothing = TRUE; } nFiles--; @@ -197,9 +194,11 @@ INT cmd_move (LPTSTR cmd, LPTSTR param) if (!bNothing) { if (MoveFile (szSrcPath, szFullDestPath)) - ConOutPrintf (_T("[OK]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); else - ConOutPrintf (_T("[Error]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, (LPTSTR) szMsg,sizeof(szMsg)); + + ConOutPrintf ((LPTSTR)szMsg); } } else @@ -219,9 +218,10 @@ INT cmd_move (LPTSTR cmd, LPTSTR param) if (!bNothing) { if (MoveFile (szSrcPath, szDestPath)) - ConOutPrintf (_T("[OK]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); else - ConOutPrintf (_T("[Error]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg); } } } @@ -238,9 +238,10 @@ INT cmd_move (LPTSTR cmd, LPTSTR param) if (!bNothing) { if (MoveFile (szSrcPath, szFullDestPath)) - ConOutPrintf (_T("[OK]\n")); - else - ConOutPrintf (_T("[Error]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + else + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg); } } } diff --git a/reactos/subsys/system/cmd/pause.c b/reactos/subsys/system/cmd/pause.c index c12362f268c..c3d6d74f7c9 100644 --- a/reactos/subsys/system/cmd/pause.c +++ b/reactos/subsys/system/cmd/pause.c @@ -18,6 +18,7 @@ */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_PAUSE @@ -29,19 +30,24 @@ * * ?? Extend to include functionality of CHOICE if switch chars * specified. + * + * 30-Apr-2005 (Magnus Olsen) ) + * Remove all hardcode string to En.rc */ INT cmd_pause (LPTSTR cmd, LPTSTR param) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + #ifdef _DEBUG DebugPrintf (_T("cmd_pause: \'%s\' : \'%s\')\n"), cmd, param); #endif if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Stops the execution of a batch file and shows the following message:\n" - "\"Press any key to continue...\" or a user defined message.\n\n" - "PAUSE [message]")); + LoadString( GetModuleHandle(NULL), STRING_PAUSE_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); + return 0; } diff --git a/reactos/subsys/system/cmd/prompt.c b/reactos/subsys/system/cmd/prompt.c index 007cccff2c5..b33f36a38ff 100644 --- a/reactos/subsys/system/cmd/prompt.c +++ b/reactos/subsys/system/cmd/prompt.c @@ -42,8 +42,12 @@ * * 24-Jan-1999 (Eric Kohl ) * Fixed Win32 environment handling. + * + * 30-Apr-2005 (Magnus Olsen) ) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" /* * print the command-line prompt @@ -178,32 +182,19 @@ VOID PrintPrompt(VOID) INT cmd_prompt (LPTSTR cmd, LPTSTR param) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Changes the command prompt.\n\n" - "PROMPT [text]\n\n" - " text Specifies a new command prompt.\n\n" - "Prompt can be made up of normal characters and the following special codes:\n\n" - " $A & (Ampersand)\n" - " $B | (pipe)\n" - " $C ( (Left parenthesis)\n" - " $D Current date\n" - " $E Escape code (ASCII code 27)\n" - " $F ) (Right parenthesis)\n" - " $G > (greater-than sign)\n" - " $H Backspace (erases previous character)\n" - " $L < (less-than sign)\n" - " $N Current drive\n" - " $P Current drive and path\n" - " $Q = (equal sign)\n" - " $T Current time\n" - " $V OS version number\n" - " $_ Carriage return and linefeed\n" - " $$ $ (dollar sign)")); + LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); + #ifdef FEATURE_DIRECTORY_STACK - ConOutPuts (_T(" $+ Displays the current depth of the directory stack")); + LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); #endif - ConOutPuts (_T("\nType PROMPT without parameters to reset the prompt to the default setting.")); + LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP3, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); return 0; } diff --git a/reactos/subsys/system/cmd/resource.h b/reactos/subsys/system/cmd/resource.h index 9897bc5d369..a5419748c0e 100644 --- a/reactos/subsys/system/cmd/resource.h +++ b/reactos/subsys/system/cmd/resource.h @@ -61,7 +61,9 @@ #define STRING_FREE_ERROR2 339 #define STRING_GOTO_ERROR1 340 #define STRING_GOTO_ERROR2 341 -#define STRING_PARAM_ERROR 342 +#define STRING_MOVE_ERROR1 342 +#define STRING_MOVE_ERROR2 343 +#define STRING_PARAM_ERROR 344 #define STRING_ATTRIB_HELP 600 @@ -137,9 +139,20 @@ #define STRING_MEMMORY_HELP1 659 #define STRING_MEMMORY_HELP2 660 -#define STRING_RMDIR_HELP 661 +#define STRING_MISC_HELP1 661 -#define STRING_REM_HELP 662 +#define STRING_MOVE_HELP1 662 +#define STRING_MOVE_HELP2 663 + +#define STRING_PAUSE_HELP1 664 + +#define STRING_PROMPT_HELP1 665 +#define STRING_PROMPT_HELP2 666 +#define STRING_PROMPT_HELP3 667 + +#define STRING_RMDIR_HELP 668 + +#define STRING_REM_HELP 669