mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
- Use fixed message buffer size.
- Don't translate command options. - Only use _one_ message buffer per function. - Fix indentation mess. svn path=/trunk/; revision=14912
This commit is contained in:
+314
-319
@@ -1,5 +1,6 @@
|
||||
#include "resource.h"
|
||||
/* Start move all hard code string to En.rc
|
||||
/*
|
||||
* Moved all hardcoded strings to En.rc.
|
||||
* By Magnus Olsen 2005
|
||||
*/
|
||||
|
||||
@@ -7,60 +8,60 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
STRING_ATTRIB_HELP, "Displays or changes file attributes.\n\n \
|
||||
ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] file ...\n \
|
||||
[/S [/D]]\n\n \
|
||||
+ Sets an attribute\n \
|
||||
- Clears an attribute\n \
|
||||
R Read-only file attribute\n \
|
||||
A Archive file attribute\n \
|
||||
S System file attribute\n \
|
||||
H Hidden file attribute\n \
|
||||
/S Processes matching files in the current directory\n \
|
||||
and all subdirectories\n \
|
||||
/D Processes direcories as well\n\n \
|
||||
STRING_ATTRIB_HELP, "Displays or changes file attributes.\n\n\
|
||||
ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] file ...\n\
|
||||
[/S [/D]]\n\n\
|
||||
+ Sets an attribute\n\
|
||||
- Clears an attribute\n\
|
||||
R Read-only file attribute\n\
|
||||
A Archive file attribute\n\
|
||||
S System file attribute\n\
|
||||
H Hidden file attribute\n\
|
||||
/S Processes matching files in the current directory\n\
|
||||
and all subdirectories\n\
|
||||
/D Processes direcories as well\n\n\
|
||||
Type ATTRIB without a parameter to display the attributes of all files."
|
||||
|
||||
STRING_ALIAS_HELP, "Sets, removes or shows aliases.\n\n \
|
||||
ALIAS [alias=[command]]\n\n \
|
||||
alias Name for an alias.\n \
|
||||
command Text to be substituted for an alias.\n\n \
|
||||
To list all aliases:\n \
|
||||
ALIAS\n\n \
|
||||
To set a new or replace an existing alias:\n \
|
||||
ALIAS da=dir a:\n\n \
|
||||
To remove an alias from the alias list:\n \
|
||||
STRING_ALIAS_HELP, "Sets, removes or shows aliases.\n\n\
|
||||
ALIAS [alias=[command]]\n\n\
|
||||
alias Name for an alias.\n\
|
||||
command Text to be substituted for an alias.\n\n\
|
||||
To list all aliases:\n\
|
||||
ALIAS\n\n\
|
||||
To set a new or replace an existing alias:\n\
|
||||
ALIAS da=dir a:\n\n\
|
||||
To remove an alias from the alias list:\n\
|
||||
ALIAS da="
|
||||
|
||||
STRING_BEEP_HELP, "Beep the speaker.\n\nBEEP"
|
||||
|
||||
STRING_CALL_HELP, "Calls one batch program from another.\n\n \
|
||||
CALL [drive:][path]filename [batch-parameter]\n\n \
|
||||
batch-parameter Specifies any command-line information required by the\n \
|
||||
STRING_CALL_HELP, "Calls one batch program from another.\n\n\
|
||||
CALL [drive:][path]filename [batch-parameter]\n\n\
|
||||
batch-parameter Specifies any command-line information required by the\n\
|
||||
batch program."
|
||||
|
||||
STRING_CD_HELP, "Changes the current directory or displays it's name\n\n \
|
||||
CHDIR [drive:][path]\n \
|
||||
CHDIR[..|-]\n \
|
||||
CD [drive:][path]\n \
|
||||
CD[..|-]\n\n \
|
||||
.. parent directory\n \
|
||||
- previous directory\n\n \
|
||||
Type CD drive: to display the current directory on the specified drive.\n \
|
||||
Type CD without a parameter to display the current drive and directory. "
|
||||
STRING_CD_HELP, "Changes the current directory or displays it's name\n\n\
|
||||
CHDIR [drive:][path]\n\
|
||||
CHDIR[..|-]\n\
|
||||
CD [drive:][path]\n\
|
||||
CD[..|-]\n\n\
|
||||
.. parent directory\n\
|
||||
- previous directory\n\n\
|
||||
Type CD drive: to display the current directory on the specified drive.\n\
|
||||
Type CD without a parameter to display the current drive and directory."
|
||||
|
||||
STRING_CHCP_HELP, "Displays or sets the active code page number.\n\n \
|
||||
CHCP [nnn]\n\n \
|
||||
nnn Specifies the active code page number.\n\n \
|
||||
STRING_CHCP_HELP, "Displays or sets the active code page number.\n\n\
|
||||
CHCP [nnn]\n\n\
|
||||
nnn Specifies the active code page number.\n\n\
|
||||
Type CHCP without a parameter to display the active code page number."
|
||||
|
||||
STRING_CHOICE_HELP, "Waits for the user to choose one of a set of choices.\n\n \
|
||||
CHOICE [/C[:]choices][/N][/S][/T[:]c,nn][text]\n\n \
|
||||
/C[:]choices Specifies allowable keys. Default is YN.\n \
|
||||
/N Do not display choices and ? at the end of the prompt string.\n \
|
||||
/S Treat choice keys as case sensitive.\n \
|
||||
/T[:]c,nn Default choice to c after nn seconds.\n \
|
||||
text Prompt string to display.\n\n \
|
||||
STRING_CHOICE_HELP, "Waits for the user to choose one of a set of choices.\n\n\
|
||||
CHOICE [/C[:]choices][/N][/S][/T[:]c,nn][text]\n\n\
|
||||
/C[:]choices Specifies allowable keys. Default is YN.\n\
|
||||
/N Do not display choices and ? at the end of the prompt string.\n\
|
||||
/S Treat choice keys as case sensitive.\n\
|
||||
/T[:]c,nn Default choice to c after nn seconds.\n\
|
||||
text Prompt string to display.\n\n\
|
||||
ERRORLEVEL is set to offset of key user presses in choices."
|
||||
|
||||
STRING_CLS_HELP, "Clears the screen.\n\nCLS"
|
||||
@@ -79,48 +80,48 @@ STRING_CMD_HELP6," [directory stack]"
|
||||
|
||||
STRING_CMD_HELP7," [redirections and piping]"
|
||||
|
||||
STRING_CMD_HELP8, "Starts a new instance of the ReactOS command line interpreter.\n\n \
|
||||
CMD [/[C|K] command][/P][/Q][/T:bf]\n\n \
|
||||
/C command Runs the specified command and terminates.\n \
|
||||
/K command Runs the specified command and remains.\n \
|
||||
/P CMD becomes permanent and runs autoexec.bat\n \
|
||||
(cannot be terminated).\n \
|
||||
STRING_CMD_HELP8, "Starts a new instance of the ReactOS command line interpreter.\n\n\
|
||||
CMD [/[C|K] command][/P][/Q][/T:bf]\n\n\
|
||||
/C command Runs the specified command and terminates.\n\
|
||||
/K command Runs the specified command and remains.\n\
|
||||
/P CMD becomes permanent and runs autoexec.bat\n\
|
||||
(cannot be terminated).\n\
|
||||
/T:bf Sets the background/foreground color (see COLOR command)."
|
||||
|
||||
STRING_COLOR_HELP1, "Sets the default foreground and background colors.\n\n \
|
||||
COLOR [attr [/F]] \n\n \
|
||||
attr Specifies color attribute of console output\n \
|
||||
/F fill the console with color attribute\n\n \
|
||||
There are three ways to specify the colors:\n \
|
||||
1) [bright] name on [bright] name (only the first three letters are required)\n \
|
||||
2) decimal on decimal\n \
|
||||
3) two hex digits\n\n \
|
||||
Colors are:\n \
|
||||
dec hex name dec hex name\n \
|
||||
0 0 Black 8 8 Gray(Bright black)\n \
|
||||
1 1 Blue 9 9 Bright Blue\n \
|
||||
2 2 Green 10 A Bright Green\n \
|
||||
3 3 Cyan 11 B Bright Cyan\n \
|
||||
4 4 Red 12 C Bright Red\n \
|
||||
5 5 Magenta 13 D Bright Magenta\n \
|
||||
6 6 Yellow 14 E Bright Yellow\n \
|
||||
STRING_COLOR_HELP1, "Sets the default foreground and background colors.\n\n\
|
||||
COLOR [attr [/F]] \n\n\
|
||||
attr Specifies color attribute of console output\n\
|
||||
/F fill the console with color attribute\n\n\
|
||||
There are three ways to specify the colors:\n\
|
||||
1) [bright] name on [bright] name (only the first three letters are required)\n\
|
||||
2) decimal on decimal\n\
|
||||
3) two hex digits\n\n\
|
||||
Colors are:\n\
|
||||
dec hex name dec hex name\n\
|
||||
0 0 Black 8 8 Gray(Bright black)\n\
|
||||
1 1 Blue 9 9 Bright Blue\n\
|
||||
2 2 Green 10 A Bright Green\n\
|
||||
3 3 Cyan 11 B Bright Cyan\n\
|
||||
4 4 Red 12 C Bright Red\n\
|
||||
5 5 Magenta 13 D Bright Magenta\n\
|
||||
6 6 Yellow 14 E Bright Yellow\n\
|
||||
7 7 White 15 F Bright White"
|
||||
|
||||
STRING_COPY_HELP1, "Overwrite %s (Yes/No/All)? "
|
||||
|
||||
STRING_COPY_HELP2, "Copies one or more files to another location.\n\n \
|
||||
COPY [/V][/Y|/-Y][/A|/B] source [/A|/B]\n \
|
||||
[+ source [/A|/B] [+ ...]] [destination [/A|/B]]\n\n \
|
||||
source Specifies the file or files to be copied.\n \
|
||||
/A Indicates an ASCII text file.\n \
|
||||
/B Indicates a binary file.\n \
|
||||
destination Specifies the directory and/or filename for the new file(s).\n \
|
||||
/V Verifies that new files are written correctly.\n \
|
||||
/Y Suppresses prompting to confirm you want to overwrite an\n \
|
||||
existing destination file.\n \
|
||||
/-Y Causes prompting to confirm you want to overwrite an\n \
|
||||
existing destination file.\n\n \
|
||||
The switch /Y may be present in the COPYCMD environment variable.\n \
|
||||
STRING_COPY_HELP2, "Copies one or more files to another location.\n\n\
|
||||
COPY [/V][/Y|/-Y][/A|/B] source [/A|/B]\n\
|
||||
[+ source [/A|/B] [+ ...]] [destination [/A|/B]]\n\n\
|
||||
source Specifies the file or files to be copied.\n\
|
||||
/A Indicates an ASCII text file.\n\
|
||||
/B Indicates a binary file.\n\
|
||||
destination Specifies the directory and/or filename for the new file(s).\n\
|
||||
/V Verifies that new files are written correctly.\n\
|
||||
/Y Suppresses prompting to confirm you want to overwrite an\n\
|
||||
existing destination file.\n\
|
||||
/-Y Causes prompting to confirm you want to overwrite an\n\
|
||||
existing destination file.\n\n\
|
||||
The switch /Y may be present in the COPYCMD environment variable.\n\
|
||||
..."
|
||||
|
||||
STRING_DATE_HELP1, "\nEnter new date (mm%cdd%cyyyy): "
|
||||
@@ -129,67 +130,67 @@ STRING_DATE_HELP2, "\nEnter new date (dd%cmm%cyyyy): "
|
||||
|
||||
STRING_DATE_HELP3, "\nEnter new date (yyyy%cmm%cdd): "
|
||||
|
||||
STRING_DATE_HELP4, "Displays or sets the date.\n\n \
|
||||
DATE [/T][date]\n\n \
|
||||
/T display only\n\n \
|
||||
Type DATE without parameters to display the current date setting and\n \
|
||||
STRING_DATE_HELP4, "Displays or sets the date.\n\n\
|
||||
DATE [/T][date]\n\n\
|
||||
/T display only\n\n\
|
||||
Type DATE without parameters to display the current date setting and\n\
|
||||
a prompt for a new one. Press ENTER to keep the same date."
|
||||
|
||||
STRING_DEL_HELP1, "Deletes one or more files.\n\n \
|
||||
DEL [/%c /%c /%c /%c /%c /%c /%c] file ...\n \
|
||||
DELETE [/%c /%c /%c /%c /%c /%c /%c] file ...\n \
|
||||
ERASE [/%c /%c /%c /%c /%c /%c /%c] file ...\n\n \
|
||||
file Specifies the file(s) to delete.\n\n \
|
||||
/%c Nothing.\n \
|
||||
/%c Prompt. Ask before deleting each file.\n \
|
||||
/%c Total. Display total number of deleted files and freed disk space.\n \
|
||||
/%c Quiet.\n \
|
||||
/%c Wipe. Overwrite the file with random numbers before deleting it.\n \
|
||||
/%c Yes. Kill even *.* without asking.\n \
|
||||
/%c Zap. Delete hidden, read-only and system files).\n"
|
||||
STRING_DEL_HELP1, "Deletes one or more files.\n\n\
|
||||
DEL [/N /P /T /Q /W /Y /Z] file ...\n\
|
||||
DELETE [/N /P /T /Q /W /Y /Z] file ...\n\
|
||||
ERASE [/N /P /T /Q /W /Y /Z] file ...\n\n\
|
||||
file Specifies the file(s) to delete.\n\n\
|
||||
/N Nothing.\n\
|
||||
/P Prompt. Ask before deleting each file.\n\
|
||||
/T Total. Display total number of deleted files and freed disk space.\n\
|
||||
/Q Quiet.\n\
|
||||
/W Wipe. Overwrite the file with random numbers before deleting it.\n\
|
||||
/Y Yes. Kill even *.* without asking.\n\
|
||||
/Z Zap. Delete hidden, read-only and system files.\n"
|
||||
|
||||
STRING_DEL_HELP2, "All files in the directory will be deleted!\nAre you sure (Y/N)?"
|
||||
STRING_DEL_HELP3, " %lu file deleted\n"
|
||||
STRING_DEL_HELP4, " %lu files deleted\n"
|
||||
|
||||
STRING_DELAY_HELP, "pause for n seconds or milliseconds\n \
|
||||
DELAY [/m]n\n\n \
|
||||
/m specifiy than n are milliseconds\n \
|
||||
STRING_DELAY_HELP, "pause for n seconds or milliseconds\n\
|
||||
DELAY [/m]n\n\n\
|
||||
/m specifiy than n are milliseconds\n\
|
||||
otherwise n are seconds"
|
||||
|
||||
STRING_DIR_HELP1, "DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n \
|
||||
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n \
|
||||
[drive:][path][filename]\n \
|
||||
Specifies drive, directory, and/or files to list.\n\n \
|
||||
/A Displays files with specified attributes.\n \
|
||||
attributes D Directories R Read-only files\n \
|
||||
H Hidden files A Files ready for archiving\n \
|
||||
S System files - Prefix meaning not\n \
|
||||
/B Uses bare format (no heading information or summary).\n \
|
||||
/C Display the thousand separator in file sizes. This is the\n \
|
||||
default. Use /-C to disable display of separator.\n \
|
||||
/D Same as wide but files are list sorted by column.\n \
|
||||
/L Uses lowercase.\n \
|
||||
/N New long list format where filenames are on the far right.\n \
|
||||
/O List by files in sorted order.\n \
|
||||
sortorder N By name (alphabetic) S By size (smallest first)\n \
|
||||
E By extension (alphabetic) D By date/time (oldest first)\n \
|
||||
G Group directories first - Prefix to reverse order\n \
|
||||
/P Pauses after each screenful of information.\n \
|
||||
/Q Display the owner of the file.\n \
|
||||
/S Displays files in specified directory and all subdirectories.\n \
|
||||
/T Controls which time field displayed or used for sorting\n \
|
||||
timefield C Creation\n \
|
||||
A Last Access\n \
|
||||
W Last Written\n \
|
||||
/W Uses wide list format.\n \
|
||||
/X This displays the short names generated for non-8dot3 file\n \
|
||||
names. The format is that of /N with the short name inserted\n \
|
||||
before the long name. If no short name is present, blanks are\n \
|
||||
displayed in its place.\n \
|
||||
/4 Displays four-digit years\n\n \
|
||||
Switches may be preset in the DIRCMD environment variable. Override\n \
|
||||
preset switches by prefixing any switch with - (hyphen)--for example, /-W.\n "
|
||||
STRING_DIR_HELP1, "DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n\
|
||||
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n\
|
||||
[drive:][path][filename]\n\
|
||||
Specifies drive, directory, and/or files to list.\n\n\
|
||||
/A Displays files with specified attributes.\n\
|
||||
attributes D Directories R Read-only files\n\
|
||||
H Hidden files A Files ready for archiving\n\
|
||||
S System files - Prefix meaning not\n\
|
||||
/B Uses bare format (no heading information or summary).\n\
|
||||
/C Display the thousand separator in file sizes. This is the\n\
|
||||
default. Use /-C to disable display of separator.\n\
|
||||
/D Same as wide but files are list sorted by column.\n\
|
||||
/L Uses lowercase.\n\
|
||||
/N New long list format where filenames are on the far right.\n\
|
||||
/O List by files in sorted order.\n\
|
||||
sortorder N By name (alphabetic) S By size (smallest first)\n\
|
||||
E By extension (alphabetic) D By date/time (oldest first)\n\
|
||||
G Group directories first - Prefix to reverse order\n\
|
||||
/P Pauses after each screenful of information.\n\
|
||||
/Q Display the owner of the file.\n\
|
||||
/S Displays files in specified directory and all subdirectories.\n\
|
||||
/T Controls which time field displayed or used for sorting\n\
|
||||
timefield C Creation\n\
|
||||
A Last Access\n\
|
||||
W Last Written\n\
|
||||
/W Uses wide list format.\n\
|
||||
/X This displays the short names generated for non-8dot3 file\n\
|
||||
names. The format is that of /N with the short name inserted\n\
|
||||
before the long name. If no short name is present, blanks are\n\
|
||||
displayed in its place.\n\
|
||||
/4 Displays four-digit years\n\n\
|
||||
Switches may be preset in the DIRCMD environment variable. Override\n\
|
||||
preset switches by prefixing any switch with - (hyphen)--for example, /-W.\n"
|
||||
|
||||
STRING_DIR_HELP2, " Volume in drive %c is %s"
|
||||
STRING_DIR_HELP3, " Volume in drive %c has no label"
|
||||
@@ -199,9 +200,9 @@ STRING_DIR_HELP6, "%16i Dir(s)% 15s bytes\n"
|
||||
STRING_DIR_HELP7, "\n Directory of %s\n\n"
|
||||
STRING_DIR_HELP8, "%16i Dir(s)% 14s bytes\n"
|
||||
|
||||
STRING_DIRSTACK_HELP1, "Stores the current directory for use by the POPD command, then\n \
|
||||
changes to the specified directory.\n\n \
|
||||
PUSHD [path | ..]\n\n \
|
||||
STRING_DIRSTACK_HELP1, "Stores the current directory for use by the POPD command, then\n\
|
||||
changes to the specified directory.\n\n\
|
||||
PUSHD [path | ..]\n\n\
|
||||
path Specifies the directory to make the current directory"
|
||||
|
||||
STRING_DIRSTACK_HELP2, "Changes to the directory stored by the PUSHD command.\n\nPOPD"
|
||||
@@ -210,61 +211,61 @@ STRING_DIRSTACK_HELP3, "Prints the contents of the directory stack.\n\nDIRS"
|
||||
|
||||
STRING_DIRSTACK_HELP4, "Directory stack empty"
|
||||
|
||||
STRING_ECHO_HELP1, "Display a messages without trailing carridge return and line feed.\n\n \
|
||||
STRING_ECHO_HELP1, "Display a messages without trailing carridge return and line feed.\n\n\
|
||||
ECHOS message"
|
||||
|
||||
STRING_ECHO_HELP2, "Displays a message to the standard error.\n\n \
|
||||
ECHOERR message\n \
|
||||
STRING_ECHO_HELP2, "Displays a message to the standard error.\n\n\
|
||||
ECHOERR message\n\
|
||||
ECHOERR. prints an empty line"
|
||||
|
||||
STRING_ECHO_HELP3, "Prints a messages to standard error output without trailing carridge return and line feed.\n\n \
|
||||
STRING_ECHO_HELP3, "Prints a messages to standard error output without trailing carridge return and line feed.\n\n\
|
||||
ECHOSERR message"
|
||||
|
||||
STRING_ECHO_HELP4, "Displays a message or switches command echoing on or off.\n\n \
|
||||
ECHO [ON | OFF]\n \
|
||||
ECHO [message]\n \
|
||||
ECHO. prints an empty line\n\n \
|
||||
STRING_ECHO_HELP4, "Displays a message or switches command echoing on or off.\n\n\
|
||||
ECHO [ON | OFF]\n\
|
||||
ECHO [message]\n\
|
||||
ECHO. prints an empty line\n\n\
|
||||
Type ECHO without a parameter to display the current ECHO setting."
|
||||
|
||||
STRING_ECHO_HELP5, "ECHO is %s\n"
|
||||
|
||||
STRING_EXIT_HELP, "Exits the command line interpreter.\n\nEXIT"
|
||||
|
||||
STRING_FOR_HELP1, "Runs a specified command for each file in a set of files\n\n \
|
||||
FOR %variable IN (set) DO command [parameters]\n\n \
|
||||
%variable Specifies a replaceable parameter.\n \
|
||||
(set) Specifies a set of one or more files. Wildcards may be used.\n \
|
||||
command Specifies the command to carry out for each file.\n \
|
||||
parameters Specifies parameters or switches for the specified command.\n\n \
|
||||
To user the FOR comamnd in a batch program, specify %%variable instead of\n \
|
||||
STRING_FOR_HELP1, "Runs a specified command for each file in a set of files\n\n\
|
||||
FOR %variable IN (set) DO command [parameters]\n\n\
|
||||
%variable Specifies a replaceable parameter.\n\
|
||||
(set) Specifies a set of one or more files. Wildcards may be used.\n\
|
||||
command Specifies the command to carry out for each file.\n\
|
||||
parameters Specifies parameters or switches for the specified command.\n\n\
|
||||
To user the FOR comamnd in a batch program, specify %%variable instead of\n\
|
||||
%variable."
|
||||
|
||||
STRING_FREE_HELP1, "\n Volume in drive %s is %-11s Serial number is %s\n \
|
||||
%16s bytes total disk space\n \
|
||||
%16s bytes used\n \
|
||||
STRING_FREE_HELP1, "\n Volume in drive %s is %-11s Serial number is %s\n\
|
||||
%16s bytes total disk space\n\
|
||||
%16s bytes used\n\
|
||||
%16s bytes free\n"
|
||||
|
||||
STRING_FREE_HELP2, "Displays drive information.\n\nFREE [drive: ...]"
|
||||
|
||||
STRING_IF_HELP1, "Performs conditional processing in batch programs.\n\n \
|
||||
IF [NOT] ERRORLEVEL number command\n \
|
||||
IF [NOT] string1==string2 command\n \
|
||||
IF [NOT] EXIST filename command\n \
|
||||
IF [NOT] DEFINED variable command\n\n \
|
||||
NOT Specifies that CMD should carry out the command only if\n \
|
||||
the condition is false\n \
|
||||
ERRORLEVEL number Specifies a true condition if the last program run returned\n \
|
||||
an exit code equal or greater than the number specified.\n \
|
||||
command Specifies the command to carry out if the condition is met.\n \
|
||||
string1==string2 Specifies a true condition if the specified text strings\n \
|
||||
match.\n \
|
||||
EXIST filename Specifies a true condition if the specified filename exists.\n \
|
||||
DEFINED variable Specifies a true condition if the specified variable is\n \
|
||||
STRING_IF_HELP1, "Performs conditional processing in batch programs.\n\n\
|
||||
IF [NOT] ERRORLEVEL number command\n\
|
||||
IF [NOT] string1==string2 command\n\
|
||||
IF [NOT] EXIST filename command\n\
|
||||
IF [NOT] DEFINED variable command\n\n\
|
||||
NOT Specifies that CMD should carry out the command only if\n\
|
||||
the condition is false\n\
|
||||
ERRORLEVEL number Specifies a true condition if the last program run returned\n\
|
||||
an exit code equal or greater than the number specified.\n\
|
||||
command Specifies the command to carry out if the condition is met.\n\
|
||||
string1==string2 Specifies a true condition if the specified text strings\n\
|
||||
match.\n\
|
||||
EXIST filename Specifies a true condition if the specified filename exists.\n\
|
||||
DEFINED variable Specifies a true condition if the specified variable is\n\
|
||||
defined."
|
||||
|
||||
STRING_GOTO_HELP1, "Directs CMD to a labeled line in a batch script.\n\n \
|
||||
GOTO label\n\n \
|
||||
label Specifies a text string used in a batch script as a label.\n\n \
|
||||
|
||||
STRING_GOTO_HELP1, "Directs CMD to a labeled line in a batch script.\n\n\
|
||||
GOTO label\n\n\
|
||||
label Specifies a text string used in a batch script as a label.\n\n\
|
||||
You type a label on a line by itself, beginning with a colon."
|
||||
|
||||
STRING_LABEL_HELP1, "Displays or changes drive label.\n\nLABEL [drive:][label]"
|
||||
@@ -276,74 +277,74 @@ STRING_LABEL_HELP5, "Drive label (11 Characters, ENTER if none)? "
|
||||
|
||||
STRING_LOCALE_HELP1, "Current time is"
|
||||
|
||||
STRING_MKDIR_HELP, "Creates a directory.\n\n \
|
||||
STRING_MKDIR_HELP, "Creates a directory.\n\n\
|
||||
MKDIR [drive:]path\nMD [drive:]path"
|
||||
|
||||
STRING_MEMMORY_HELP1, "Displays the amount of system memory.\n\nMEMORY"
|
||||
|
||||
STRING_MEMMORY_HELP2, "\n %12s%% memory load.\n\n \
|
||||
%13s bytes total physical RAM.\n \
|
||||
%13s bytes available physical RAM.\n\n \
|
||||
%13s bytes total page file.\n \
|
||||
%13s bytes available page file.\n\n \
|
||||
%13s bytes total virtual memory.\n \
|
||||
STRING_MEMMORY_HELP2, "\n %12s%% memory load.\n\n\
|
||||
%13s bytes total physical RAM.\n\
|
||||
%13s bytes available physical RAM.\n\n\
|
||||
%13s bytes total page file.\n\
|
||||
%13s bytes available page file.\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 \
|
||||
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. Do everything 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_MSGBOX_HELP, "display a message box and return user responce\n\n \
|
||||
MSGBOX type ['title'] prompt\n\n \
|
||||
type button displayed\n \
|
||||
possible values are: OK, OKCANCEL,\n \
|
||||
YESNO, YESNOCANCEL\n \
|
||||
title title of message box\n \
|
||||
prompt text displayed by the message box\n\n\n \
|
||||
ERRORLEVEL is set according the button pressed:\n\n \
|
||||
YES : 10 | NO : 11\n \
|
||||
STRING_MSGBOX_HELP, "display a message box and return user responce\n\n\
|
||||
MSGBOX type ['title'] prompt\n\n\
|
||||
type button displayed\n\
|
||||
possible values are: OK, OKCANCEL,\n\
|
||||
YESNO, YESNOCANCEL\n\
|
||||
title title of message box\n\
|
||||
prompt text displayed by the message box\n\n\n\
|
||||
ERRORLEVEL is set according the button pressed:\n\n\
|
||||
YES : 10 | NO : 11\n\
|
||||
OK : 10 | CANCEL : 12\n"
|
||||
|
||||
STRING_PATH_HELP1, "Displays or sets a search path for executable files.\n\n \
|
||||
PATH [[drive:]path[;...]]\nPATH ;\n\n \
|
||||
Type PATH ; to clear all search-path settings and direct the command shell\n \
|
||||
to search only in the current directory.\n \
|
||||
STRING_PATH_HELP1, "Displays or sets a search path for executable files.\n\n\
|
||||
PATH [[drive:]path[;...]]\nPATH ;\n\n\
|
||||
Type PATH ; to clear all search-path settings and direct the command shell\n\
|
||||
to search only in the current directory.\n\
|
||||
Type PATH without parameters to display the current path.\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 \
|
||||
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 \
|
||||
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"
|
||||
@@ -352,53 +353,53 @@ STRING_PROMPT_HELP3, "\nType PROMPT without parameters to reset the prompt to th
|
||||
|
||||
STRING_REM_HELP, "Starts a comment line in a batch file.\n\nREM [Comment]"
|
||||
|
||||
STRING_RMDIR_HELP, "Removes a directory.\n\n \
|
||||
RMDIR [drive:]path\nRD [drive:]path"
|
||||
STRING_RMDIR_HELP, "Removes a directory.\n\n\
|
||||
RMDIR [drive:]path\nRD [drive:]path"
|
||||
|
||||
STRING_REN_HELP1, "Renames a file/directory or files/directories.\n\n \
|
||||
RENAME [/E /N /P /Q /S /T] old_name ... new_name\n \
|
||||
REN [/E /N /P /Q /S /T] old_name ... new_name\n\n \
|
||||
/E No eror messages.\n \
|
||||
/N Nothing.\n \
|
||||
/P Prompts for confirmation before renaming each file.\n \
|
||||
(Not implemented yet!)\n \
|
||||
/Q Quiet.\n \
|
||||
/S Rename subdirectories.\n \
|
||||
/T Display total number of renamed files.\n\n \
|
||||
Note that you cannot specify a new drive or path for your destination. Use\n \
|
||||
STRING_REN_HELP1, "Renames a file/directory or files/directories.\n\n\
|
||||
RENAME [/E /N /P /Q /S /T] old_name ... new_name\n\
|
||||
REN [/E /N /P /Q /S /T] old_name ... new_name\n\n\
|
||||
/E No eror messages.\n\
|
||||
/N Nothing.\n\
|
||||
/P Prompts for confirmation before renaming each file.\n\
|
||||
(Not implemented yet!)\n\
|
||||
/Q Quiet.\n\
|
||||
/S Rename subdirectories.\n\
|
||||
/T Display total number of renamed files.\n\n\
|
||||
Note that you cannot specify a new drive or path for your destination. Use\n\
|
||||
the MOVE command for that purpose."
|
||||
|
||||
STRING_REN_HELP2, " %lu file renamed\n"
|
||||
|
||||
STRING_REN_HELP3, " %lu files renamed\n"
|
||||
|
||||
STRING_SHIFT_HELP, "Changes the position of replaceable parameters in a batch file.\n\n \
|
||||
STRING_SHIFT_HELP, "Changes the position of replaceable parameters in a batch file.\n\n\
|
||||
SHIFT [DOWN]"
|
||||
|
||||
STRING_SCREEN_HELP, "move cursor and optionally print text\n\n \
|
||||
SCREEN row col [text]\n\n \
|
||||
row row to wich move the cursor\n \
|
||||
STRING_SCREEN_HELP, "move cursor and optionally print text\n\n\
|
||||
SCREEN row col [text]\n\n\
|
||||
row row to wich move the cursor\n\
|
||||
col column to wich move the cursor"
|
||||
|
||||
STRING_SET_HELP, "Displays, sets, or removes environment variables.\n\n \
|
||||
SET [variable[=][string]]\n\n \
|
||||
variable Specifies the environment-variable name.\n \
|
||||
string Specifies a series of characters to assign to the variable.\n\n \
|
||||
STRING_SET_HELP, "Displays, sets, or removes environment variables.\n\n\
|
||||
SET [variable[=][string]]\n\n\
|
||||
variable Specifies the environment-variable name.\n\
|
||||
string Specifies a series of characters to assign to the variable.\n\n\
|
||||
Type SET without parameters to display the current environment variables.\n"
|
||||
|
||||
STRING_START_HELP1, "Starts a command.\n\n \
|
||||
START command \n\n \
|
||||
command Specifies the command to run.\n\n \
|
||||
STRING_START_HELP1, "Starts a command.\n\n\
|
||||
START command\n\n\
|
||||
command Specifies the command to run.\n\n\
|
||||
At the moment all commands are started asynchronously.\n"
|
||||
|
||||
STRING_TITLE_HELP, "Sets the window title for the command prompt window.\n\n \
|
||||
TITLE [string]\n\n \
|
||||
STRING_TITLE_HELP, "Sets the window title for the command prompt window.\n\n\
|
||||
TITLE [string]\n\n\
|
||||
string Specifies the title for the command prompt window."
|
||||
|
||||
STRING_TIME_HELP1, "Displays or sets the system time.\n\n \
|
||||
TIME [/T][time]\n\n \
|
||||
/T display only\n\n \
|
||||
Type TIME with no parameters to display the current time setting and a prompt\n \
|
||||
STRING_TIME_HELP1, "Displays or sets the system time.\n\n\
|
||||
TIME [/T][time]\n\n\
|
||||
/T display only\n\n\
|
||||
Type TIME with no parameters to display the current time setting and a prompt\n\
|
||||
for a new one. Press ENTER to keep the same time."
|
||||
|
||||
STRING_TIME_HELP2, "Enter new time: "
|
||||
@@ -407,88 +408,88 @@ STRING_TIMER_HELP1, "Elapsed %d msecs\n"
|
||||
|
||||
STRING_TIMER_HELP2, "Elapsed %02d%c%02d%c%02d%c%02d\n"
|
||||
|
||||
STRING_TIMER_HELP3, "allow the use of ten stopwaches.\n\n \
|
||||
TIMER [ON|OFF] [/S] [/n] [/Fn]\n\n \
|
||||
ON set stopwach ON\n \
|
||||
OFF set stopwach OFF\n \
|
||||
/S Split time. Return stopwach split\n \
|
||||
time without changing its value\n \
|
||||
/n Specifiy the stopwach number.\n \
|
||||
Stopwaches avaliable are 0 to 10\n \
|
||||
If it is not specified default is 1\n \
|
||||
/Fn Format for output\n \
|
||||
n can be:\n \
|
||||
0 milliseconds\n \
|
||||
1 hh%cmm%css%cdd\n\n \
|
||||
if none of ON, OFF or /S is specified the command\n \
|
||||
STRING_TIMER_HELP3, "allow the use of ten stopwaches.\n\n\
|
||||
TIMER [ON|OFF] [/S] [/n] [/Fn]\n\n\
|
||||
ON set stopwach ON\n\
|
||||
OFF set stopwach OFF\n\
|
||||
/S Split time. Return stopwach split\n\
|
||||
time without changing its value\n\
|
||||
/n Specifiy the stopwach number.\n\
|
||||
Stopwaches avaliable are 0 to 10\n\
|
||||
If it is not specified default is 1\n\
|
||||
/Fn Format for output\n\
|
||||
n can be:\n\
|
||||
0 milliseconds\n\
|
||||
1 hh%cmm%css%cdd\n\n\
|
||||
if none of ON, OFF or /S is specified the command\n\
|
||||
will toggle stopwach state\n\n"
|
||||
|
||||
|
||||
STRING_TYPE_HELP1, "Displays the contents of text files.\n\nTYPE [drive:][path]filename"
|
||||
|
||||
STRING_VERIFY_HELP1, "This command is just a dummy!!\n \
|
||||
Sets whether to verify that your files are written correctly to a\n \
|
||||
disk.\n\n \
|
||||
VERIFY [ON | OFF]\n\n \
|
||||
STRING_VERIFY_HELP1, "This command is just a dummy!!\n\
|
||||
Sets whether to verify that your files are written correctly to a\n\
|
||||
disk.\n\n\
|
||||
VERIFY [ON | OFF]\n\n\
|
||||
Type VERIFY without a parameter to display the current VERIFY setting."
|
||||
|
||||
STRING_VERIFY_HELP2, "VERIFY is %s.\n"
|
||||
|
||||
STRING_VERIFY_HELP3, "Must specify ON or OFF."
|
||||
|
||||
STRING_VERSION_HELP1, "Displays shell version information\n\n \
|
||||
VER [/C][/R][/W]\n\n \
|
||||
/C Displays credits.\n \
|
||||
/R Displays redistribution information.\n \
|
||||
STRING_VERSION_HELP1, "Displays shell version information\n\n\
|
||||
VER [/C][/R][/W]\n\n\
|
||||
/C Displays credits.\n\
|
||||
/R Displays redistribution information.\n\
|
||||
/W Displays warranty information."
|
||||
|
||||
STRING_VERSION_HELP2, " comes with ABSOLUTELY NO WARRANTY; for details\n \
|
||||
type: `ver /w'. This is free software, and you are welcome to redistribute\n \
|
||||
it under certain conditions; type `ver /r' for details. Type `ver /c' for a\n \
|
||||
STRING_VERSION_HELP2, " comes with ABSOLUTELY NO WARRANTY; for details\n\
|
||||
type: `ver /w'. This is free software, and you are welcome to redistribute\n\
|
||||
it under certain conditions; type `ver /r' for details. Type `ver /c' for a\n\
|
||||
listing of credits."
|
||||
|
||||
STRING_VERSION_HELP3, "\n This program is distributed in the hope that it will be useful,\n \
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of\n \
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n \
|
||||
STRING_VERSION_HELP3, "\n This program is distributed in the hope that it will be useful,\n\
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
|
||||
GNU General Public License for more details."
|
||||
|
||||
STRING_VERSION_HELP4, "\n This program is free software; you can redistribute it and/or modify\n \
|
||||
it under the terms of the GNU General Public License as published by\n \
|
||||
the Free Software Foundation; either version 2 of the License, or\n \
|
||||
STRING_VERSION_HELP4, "\n This program is free software; you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
the Free Software Foundation; either version 2 of the License, or\n\
|
||||
(at your option) any later version."
|
||||
|
||||
STRING_VERSION_HELP5, "\nSend bug reports to <[email protected]>.\n \
|
||||
STRING_VERSION_HELP5, "\nSend bug reports to <[email protected]>.\n\
|
||||
Updates are available at: http://www.reactos.com"
|
||||
|
||||
STRING_VERSION_HELP6, "FreeDOS version written by:\n%s\nReactOS version written by:\n%s\n"
|
||||
STRING_VERSION_HELP6, "\nFreeDOS version written by:\n"
|
||||
|
||||
STRING_VERSION_HELP7, "\nReactOS version written by:\n"
|
||||
|
||||
STRING_VOL_HELP1, " Volume in drive %c: is %s"
|
||||
STRING_VOL_HELP2, " Volume in drive %c: has no label"
|
||||
STRING_VOL_HELP3, " Volume Serial Number is %04X-%04X\n"
|
||||
STRING_VOL_HELP4, "Displays the disk volume label and serial number, if they exist.\n\nVOL [drive:]"
|
||||
|
||||
STRING_WINDOW_HELP1, "change console window aspect\n\n \
|
||||
WINDOW [/POS[=]left,top,width,heigth]\n \
|
||||
[MIN|MAX|RESTORE] ['title']\n\n \
|
||||
/POS specify window placement and dimensions\n \
|
||||
MIN minimize the window\n \
|
||||
MAX maximize the window\n \
|
||||
STRING_WINDOW_HELP1, "change console window aspect\n\n\
|
||||
WINDOW [/POS[=]left,top,width,heigth]\n\
|
||||
[MIN|MAX|RESTORE] ['title']\n\n\
|
||||
/POS specify window placement and dimensions\n\
|
||||
MIN minimize the window\n\
|
||||
MAX maximize the window\n\
|
||||
RESTORE restore the window"
|
||||
|
||||
STRING_WINDOW_HELP2, "change console window aspect\n\n \
|
||||
ACTIAVTE 'window' [/POS[=]left,top,width,heigth]\n \
|
||||
[MIN|MAX|RESTORE] ['title']\n\n \
|
||||
window tile of window on wich perform actions\n \
|
||||
/POS specify window placement and dimensions\n \
|
||||
MIN minimize the window\n \
|
||||
MAX maximize the window\n \
|
||||
RESTORE restore the window\n \
|
||||
title new title"
|
||||
STRING_WINDOW_HELP2, "change console window aspect\n\n\
|
||||
ACTIAVTE 'window' [/POS[=]left,top,width,heigth]\n\
|
||||
[MIN|MAX|RESTORE] ['title']\n\n\
|
||||
window tile of window on wich perform actions\n\
|
||||
/POS specify window placement and dimensions\n\
|
||||
MIN minimize the window\n\
|
||||
MAX maximize the window\n\
|
||||
RESTORE restore the window\n\
|
||||
title new title"
|
||||
|
||||
|
||||
|
||||
STRING_CHOICE_OPTION, "YN"
|
||||
STRING_COPY_OPTION, "YNA"
|
||||
STRING_DEL_OPTION, "AENPQSTWXYZ"
|
||||
|
||||
|
||||
STRING_ALIAS_ERROR, "Command line too long after alias expansion!\n"
|
||||
@@ -515,20 +516,15 @@ STRING_COPY_ERROR2, "Error: Can't copy onto itself!\n"
|
||||
STRING_COPY_ERROR3, "Error writing destination!\n"
|
||||
STRING_COPY_ERROR4, "Error: Not implemented yet!\n"
|
||||
STRING_DATE_ERROR, "Invalid date."
|
||||
STRING_DEL_ERROR1, "Wildcards!\n\n"
|
||||
STRING_DEL_ERROR2, "Full path: %s\n"
|
||||
STRING_DEL_ERROR3, "File part: %s\n"
|
||||
STRING_DEL_ERROR4, "Full filename: %s\n"
|
||||
STRING_DEL_ERROR5, "The file %s will be deleted! "
|
||||
STRING_DEL_ERROR6, "Are you sure (Y/N)?"
|
||||
STRING_DEL_ERROR7, "Deleting: %s\n"
|
||||
STRING_DEL_ERROR8, "No Wildcards!\n"
|
||||
STRING_ERROR_ERROR1, "Unknown error! Error code: 0x%lx\n"
|
||||
STRING_ERROR_ERROR2, "Syntax error"
|
||||
STRING_FOR_ERROR1, "'in' missing in for statement."
|
||||
STRING_FOR_ERROR2, "no brackets found."
|
||||
STRING_FOR_ERROR3, "'do' missing."
|
||||
STRING_FOR_ERROR4, "no command after 'do'."
|
||||
STRING_FOR_ERROR4, "no command after 'do'."
|
||||
STRING_FREE_ERROR1, "Invalid drive"
|
||||
STRING_FREE_ERROR2, "unlabeled"
|
||||
STRING_GOTO_ERROR1, "No label specified for GOTO"
|
||||
@@ -552,18 +548,17 @@ STRING_TYPE_ERROR1, "Invalid option '/%s'\n"
|
||||
STRING_WINDOW_ERROR1, "window not found"
|
||||
|
||||
|
||||
STRING_ERROR_PARAMETERF_ERROR, "Parameter format not correct - %c\n"
|
||||
STRING_ERROR_PARAMETERF_ERROR, "Parameter format not correct - %c\n"
|
||||
STRING_ERROR_INVALID_SWITCH, "Invalid switch - /%c\n"
|
||||
STRING_ERROR_TOO_MANY_PARAMETERS, "Too many parameters - %s\n"
|
||||
STRING_ERROR_PATH_NOT_FOUND, "Path not found\n"
|
||||
STRING_ERROR_FILE_NOT_FOUND, "File not found\n"
|
||||
STRING_ERROR_REQ_PARAM_MISSING, "Required parameter missing\n"
|
||||
STRING_ERROR_INVALID_DRIVE, "Invalid drive specification\n"
|
||||
STRING_ERROR_PATH_NOT_FOUND, "Path not found\n"
|
||||
STRING_ERROR_FILE_NOT_FOUND, "File not found\n"
|
||||
STRING_ERROR_REQ_PARAM_MISSING, "Required parameter missing\n"
|
||||
STRING_ERROR_INVALID_DRIVE, "Invalid drive specification\n"
|
||||
STRING_ERROR_INVALID_PARAM_FORMAT, "Invalid parameter format - %s\n"
|
||||
STRING_ERROR_BADCOMMAND, "Bad command or filename\n"
|
||||
STRING_ERROR_OUT_OF_MEMORY, "Out of memory error.\n"
|
||||
STRING_ERROR_CANNOTPIPE, "Error! Cannot pipe! Cannot open temporary file!\n"
|
||||
STRING_ERROR_D_PAUSEMSG, "Press any key to continue . . ."
|
||||
STRING_ERROR_DRIVER_NOT_READY "Drive not ready"
|
||||
|
||||
STRING_ERROR_BADCOMMAND, "Bad command or filename\n"
|
||||
STRING_ERROR_OUT_OF_MEMORY, "Out of memory error.\n"
|
||||
STRING_ERROR_CANNOTPIPE, "Error! Cannot pipe! Cannot open temporary file!\n"
|
||||
STRING_ERROR_D_PAUSEMSG, "Press any key to continue . . ."
|
||||
STRING_ERROR_DRIVER_NOT_READY "Drive not ready"
|
||||
}
|
||||
|
||||
@@ -281,8 +281,9 @@ VOID ExpandAlias (LPTSTR cmd, INT maxlen)
|
||||
m = _tcslen (ptr->lpSubst);
|
||||
if ((int)(_tcslen (cmd) - len + m - n) > maxlen)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ALIAS_ERROR, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_ALIAS_ERROR, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
|
||||
/* the parser won't cause any problems with an empty line */
|
||||
cmd[0] = _T('\0');
|
||||
}
|
||||
@@ -305,13 +306,13 @@ VOID ExpandAlias (LPTSTR cmd, INT maxlen)
|
||||
|
||||
INT CommandAlias (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
LPTSTR ptr;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR ptr;
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ALIAS_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_ALIAS_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ PrintAttribute (LPTSTR pszPath, LPTSTR pszFile, BOOL bRecurse)
|
||||
WIN32_FIND_DATA findData;
|
||||
HANDLE hFind;
|
||||
TCHAR szFullName[MAX_PATH];
|
||||
LPTSTR pszFileName;
|
||||
LPTSTR pszFileName;
|
||||
|
||||
/* prepare full file name buffer */
|
||||
_tcscpy (szFullName, pszPath);
|
||||
@@ -112,7 +112,7 @@ PrintAttribute (LPTSTR pszPath, LPTSTR pszFile, BOOL bRecurse)
|
||||
|
||||
static VOID
|
||||
ChangeAttribute (LPTSTR pszPath, LPTSTR pszFile, DWORD dwMask,
|
||||
DWORD dwAttrib, BOOL bRecurse, BOOL bDirectories)
|
||||
DWORD dwAttrib, BOOL bRecurse, BOOL bDirectories)
|
||||
{
|
||||
WIN32_FIND_DATA findData;
|
||||
HANDLE hFind;
|
||||
@@ -143,7 +143,7 @@ ChangeAttribute (LPTSTR pszPath, LPTSTR pszFile, DWORD dwMask,
|
||||
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
if (!_tcscmp (findData.cFileName, _T(".")) ||
|
||||
!_tcscmp (findData.cFileName, _T("..")))
|
||||
!_tcscmp (findData.cFileName, _T("..")))
|
||||
continue;
|
||||
|
||||
_tcscpy (pszFileName, findData.cFileName);
|
||||
@@ -189,6 +189,7 @@ ChangeAttribute (LPTSTR pszPath, LPTSTR pszFile, DWORD dwMask,
|
||||
|
||||
INT CommandAttrib (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR *arg;
|
||||
INT argc, i;
|
||||
TCHAR szPath[MAX_PATH];
|
||||
@@ -197,7 +198,6 @@ INT CommandAttrib (LPTSTR cmd, LPTSTR param)
|
||||
BOOL bDirectories = FALSE;
|
||||
DWORD dwAttrib = 0;
|
||||
DWORD dwMask = 0;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
/* initialize strings */
|
||||
szPath[0] = _T('\0');
|
||||
@@ -206,8 +206,8 @@ INT CommandAttrib (LPTSTR cmd, LPTSTR param)
|
||||
/* print help */
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ATTRIB_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_ATTRIB_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ INT CommandAttrib (LPTSTR cmd, LPTSTR param)
|
||||
/* get full file name */
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
if ((*arg[i] != _T('+')) && (*arg[i] != _T('-')) && (*arg[i] != _T('/')))
|
||||
if ((*arg[i] != _T('+')) && (*arg[i] != _T('-')) && (*arg[i] != _T('/')))
|
||||
{
|
||||
LPTSTR p;
|
||||
GetFullPathName (arg[i], MAX_PATH, szPath, NULL);
|
||||
@@ -333,7 +333,7 @@ INT CommandAttrib (LPTSTR cmd, LPTSTR param)
|
||||
PrintAttribute (szPath, szFileName, bRecurse);
|
||||
else
|
||||
ChangeAttribute (szPath, szFileName, dwMask,
|
||||
dwAttrib, bRecurse, bDirectories);
|
||||
dwAttrib, bRecurse, bDirectories);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* BATCH.C - batch file processor for CMD.EXE.
|
||||
*
|
||||
*
|
||||
@@ -218,12 +217,12 @@ VOID ExitBatch (LPTSTR msg)
|
||||
|
||||
BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
||||
{
|
||||
HANDLE hFile;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
HANDLE hFile;
|
||||
|
||||
hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL |
|
||||
FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL |
|
||||
FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("Batch: (\'%s\', \'%s\', \'%s\') hFile = %x\n"),
|
||||
@@ -232,8 +231,8 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_BATCH_ERROR, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_BATCH_ERROR, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ INT cmd_beep (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (_tcsncmp (param, _T("/?"), 2) == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ALIAS_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts ((LPTSTR)szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_ALIAS_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* CALL.C - call internal batch command.
|
||||
*
|
||||
*
|
||||
@@ -44,17 +43,16 @@
|
||||
|
||||
INT cmd_call (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
LPBATCH_CONTEXT n = NULL;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPBATCH_CONTEXT n = NULL;
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("cmd_call: (\'%s\',\'%s\')\n"), cmd, param);
|
||||
#endif
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CALL_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts ((LPTSTR)szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_CALL_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
|
||||
INT CommandChcp (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR *arg;
|
||||
INT args;
|
||||
UINT uOldCodePage;
|
||||
UINT uNewCodePage;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
/* print help */
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHCP_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHCP_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -38,39 +38,37 @@ INT CommandChcp (LPTSTR cmd, LPTSTR param)
|
||||
if (args == 0)
|
||||
{
|
||||
/* display active code page number */
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHCP_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, GetConsoleCP ());
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHCP_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, GetConsoleCP());
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (args >= 2)
|
||||
{
|
||||
/* too many parameters */
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHCP_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, param);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHCP_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, param);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* save old code page */
|
||||
uOldCodePage = GetConsoleCP ();
|
||||
uOldCodePage = GetConsoleCP();
|
||||
|
||||
uNewCodePage = (UINT)_ttoi (arg[0]);
|
||||
uNewCodePage = (UINT)_ttoi(arg[0]);
|
||||
|
||||
if (uNewCodePage == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHCP_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, arg[0]);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHCP_ERROR3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, arg[0]);
|
||||
freep (arg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!SetConsoleCP (uNewCodePage))
|
||||
if (!SetConsoleCP(uNewCodePage))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHCP_ERROR4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHCP_ERROR4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -103,6 +103,7 @@ IsKeyInString (LPTSTR lpString, TCHAR cKey, BOOL bCaseSensitive)
|
||||
INT
|
||||
CommandChoice (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR lpOptions;
|
||||
TCHAR Options[2];
|
||||
LPTSTR lpText = NULL;
|
||||
@@ -121,16 +122,15 @@ CommandChoice (LPTSTR cmd, LPTSTR param)
|
||||
INT GCret;
|
||||
TCHAR Ch;
|
||||
DWORD amount,clk;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHOICE_OPTION, Options,sizeof(lpOptions)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHOICE_OPTION, Options, 2);
|
||||
lpOptions = Options;
|
||||
|
||||
if (_tcsncmp (param, _T("/?"), 2) == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHOICE_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
return 0;
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHOICE_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* retrieve text */
|
||||
@@ -169,9 +169,8 @@ CommandChoice (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (_tcslen (lpOptions) == 0)
|
||||
{
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHOICE_ERROR, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHOICE_ERROR, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPuts(szMsg);
|
||||
freep (arg);
|
||||
return 1;
|
||||
}
|
||||
@@ -201,8 +200,8 @@ CommandChoice (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (*s != _T(','))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHOICE_ERROR_TXT, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHOICE_ERROR_TXT, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPuts(szMsg);
|
||||
freep (arg);
|
||||
return 1;
|
||||
}
|
||||
@@ -213,8 +212,8 @@ CommandChoice (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
else if (arg[i][0] == _T('/'))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHOICE_ERROR_OPTION, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, arg[i]);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHOICE_ERROR_OPTION, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, arg[i]);
|
||||
freep (arg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -33,29 +33,29 @@
|
||||
|
||||
INT cmd_cls (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
DWORD dwWritten;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
COORD coPos;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
DWORD dwWritten;
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CLS_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CLS_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
GetConsoleScreenBufferInfo (hConsole, &csbi);
|
||||
GetConsoleScreenBufferInfo(hConsole, &csbi);
|
||||
|
||||
coPos.X = 0;
|
||||
coPos.Y = 0;
|
||||
FillConsoleOutputAttribute (hConsole, wColor,
|
||||
(csbi.dwSize.X)*(csbi.dwSize.Y),
|
||||
coPos, &dwWritten);
|
||||
FillConsoleOutputCharacter (hConsole, _T(' '),
|
||||
(csbi.dwSize.X)*(csbi.dwSize.Y),
|
||||
coPos, &dwWritten);
|
||||
SetConsoleCursorPosition (hConsole, coPos);
|
||||
FillConsoleOutputAttribute(hConsole, wColor,
|
||||
csbi.dwSize.X * csbi.dwSize.Y,
|
||||
coPos, &dwWritten);
|
||||
FillConsoleOutputCharacter(hConsole, _T(' '),
|
||||
csbi.dwSize.X * csbi.dwSize.Y,
|
||||
coPos, &dwWritten);
|
||||
SetConsoleCursorPosition(hConsole, coPos);
|
||||
|
||||
bIgnoreEcho = TRUE;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* CMD.C - command-line interface.
|
||||
*
|
||||
*
|
||||
@@ -550,9 +549,9 @@ DoCommand (LPTSTR line)
|
||||
|
||||
VOID ParseCommandLine (LPTSTR cmd)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR cmdline[CMDLINE_LENGTH];
|
||||
LPTSTR s;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
#ifdef FEATURE_REDIRECTION
|
||||
TCHAR in[CMDLINE_LENGTH] = _T("");
|
||||
TCHAR out[CMDLINE_LENGTH] = _T("");
|
||||
@@ -634,15 +633,15 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, in);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, in);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SetStdHandle (STD_INPUT_HANDLE, hFile))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, in);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, in);
|
||||
return;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
@@ -664,13 +663,12 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||
/* Set current stdout to temporary file */
|
||||
hFile[1] = CreateFile (szFileName[1], GENERIC_WRITE, 0, &sa,
|
||||
TRUNCATE_EXISTING, FILE_ATTRIBUTE_TEMPORARY, NULL);
|
||||
|
||||
if (hFile[1] == INVALID_HANDLE_VALUE){
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
return;
|
||||
}
|
||||
if (hFile[1] == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
SetStdHandle (STD_OUTPUT_HANDLE, hFile[1]);
|
||||
|
||||
@@ -720,16 +718,15 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, out);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, out);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SetStdHandle (STD_OUTPUT_HANDLE, hFile))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, out);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, out);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -782,17 +779,16 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||
NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, err);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!SetStdHandle (STD_ERROR_HANDLE, hFile))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, err);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, err);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1079,35 +1075,35 @@ ShowCommands (VOID)
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
/* print command list */
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg);
|
||||
PrintCommandList ();
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
PrintCommandList();
|
||||
|
||||
/* print feature list */
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
|
||||
#ifdef FEATURE_ALIASES
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
#endif
|
||||
#ifdef FEATURE_HISTORY
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_HELP4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
#endif
|
||||
#ifdef FEATURE_UNIX_FILENAME_COMPLETION
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_HELP5, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_HELP5, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
#endif
|
||||
#ifdef FEATURE_DIRECTORY_STACK
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_HELP6, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_HELP6, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
#endif
|
||||
#ifdef FEATURE_REDIRECTION
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_HELP7, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_HELP7, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
#endif
|
||||
ConOutChar (_T('\n'));
|
||||
ConOutChar(_T('\n'));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1121,10 +1117,10 @@ ShowCommands (VOID)
|
||||
static VOID
|
||||
Initialize (int argc, TCHAR* argv[])
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR commandline[CMDLINE_LENGTH];
|
||||
TCHAR ModuleName[_MAX_PATH + 1];
|
||||
INT i;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
//INT len;
|
||||
//TCHAR *ptr, *cmdLine;
|
||||
@@ -1154,9 +1150,9 @@ Initialize (int argc, TCHAR* argv[])
|
||||
|
||||
if (argc >= 2 && !_tcsncmp (argv[1], _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_HELP8, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
ExitProcess (0);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_HELP8, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
ExitProcess(0);
|
||||
}
|
||||
SetConsoleMode (hIn, ENABLE_PROCESSED_INPUT);
|
||||
|
||||
@@ -1259,8 +1255,8 @@ Initialize (int argc, TCHAR* argv[])
|
||||
|
||||
if (IsExistingFile (_T("commandline")))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, commandline);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, commandline);
|
||||
ParseCommandLine (commandline);
|
||||
}
|
||||
}
|
||||
@@ -1296,15 +1292,15 @@ static VOID Cleanup (int argc, TCHAR *argv[])
|
||||
/* run cmdexit.bat */
|
||||
if (IsExistingFile (_T("cmdexit.bat")))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR5, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR5, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
|
||||
ParseCommandLine (_T("cmdexit.bat"));
|
||||
}
|
||||
else if (IsExistingFile (_T("\\cmdexit.bat")))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR5, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR5, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf ((LPTSTR)szMsg);
|
||||
ParseCommandLine (_T("\\cmdexit.bat"));
|
||||
}
|
||||
#ifndef __REACTOS__
|
||||
@@ -1320,8 +1316,8 @@ static VOID Cleanup (int argc, TCHAR *argv[])
|
||||
|
||||
if (IsExistingFile (_T("commandline")))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CMD_ERROR4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, commandline);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CMD_ERROR4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, commandline);
|
||||
ParseCommandLine (commandline);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* CMD.H - header file for the modules in CMD.EXE
|
||||
*
|
||||
*
|
||||
@@ -170,7 +169,7 @@ VOID ConOutPrintf (LPTSTR, ...);
|
||||
VOID ConErrChar (TCHAR);
|
||||
VOID ConErrPuts (LPTSTR);
|
||||
VOID ConErrPrintf (LPTSTR, ...);
|
||||
VOID ConOutFormatMessage (DWORD MessageId, ...);
|
||||
VOID ConOutFormatMessage (DWORD MessageId, ...);
|
||||
|
||||
SHORT GetCursorX (VOID);
|
||||
SHORT GetCursorY (VOID);
|
||||
|
||||
@@ -5,26 +5,25 @@
|
||||
#define REACTOS_STR_INTERNAL_NAME "cmd\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "cmd.exe\0"
|
||||
#define REACTOS_STR_ORIGINAL_COPYRIGHT "Copyright (C) 1994-1998 Tim Norman and others\0"
|
||||
#define REACTOS_STR_LEGAL_COPYRIGHT "Copyright (C) 1998-2001 Eric Kohl and others\0"
|
||||
#define REACTOS_STR_LEGAL_COPYRIGHT "Copyright (C) 1998-2005 Eric Kohl and others\0"
|
||||
|
||||
#include <reactos/version.rc>
|
||||
#include "En.rc"
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
STRING_FreeDOS_DEV, " Tim Norman Matt Rains\n \
|
||||
Evan Jeffrey Steffen Kaiser\n \
|
||||
Svante Frey Oliver Mueller\n \
|
||||
Aaron Kaufman Marc Desrochers\n \
|
||||
Rob Lake John P Price\n \
|
||||
STRING_FREEDOS_DEV, " Tim Norman Matt Rains\n\
|
||||
Evan Jeffrey Steffen Kaiser\n\
|
||||
Svante Frey Oliver Mueller\n\
|
||||
Aaron Kaufman Marc Desrochers\n\
|
||||
Rob Lake John P Price\n\
|
||||
Hans B Pufal\n"
|
||||
|
||||
STRING_REACTOS_DEV, " Eric Kohl Emanuele Aliberti\n \
|
||||
STRING_REACTOS_DEV, " Eric Kohl Emanuele Aliberti\n\
|
||||
Paolo Pantaleo Phillip Susi\n"
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
1 ICON DISCARDABLE res/terminal.ico
|
||||
1 ICON DISCARDABLE res/terminal.ico
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
|
||||
{
|
||||
if (((charcount + orgx) / maxx) + orgy > maxy - 1)
|
||||
orgy += maxy - ((charcount + orgx) / maxx + orgy + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* set cursor position */
|
||||
SetCursorXY ((orgx + current) % maxx,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* COLOR.C - color internal command.
|
||||
*
|
||||
*
|
||||
@@ -15,10 +14,10 @@
|
||||
* Redirection ready!
|
||||
*
|
||||
* 14-Oct-1999 (Paolo Pantaleo <[email protected]>)
|
||||
* 4nt's syntax implemented
|
||||
* 4nt's syntax implemented.
|
||||
*
|
||||
* 03-Apr-2005 (Magnus Olsen) <[email protected]>)
|
||||
* Remove all hardcode string to En.rc
|
||||
* Move all hardcoded strings to En.rc.
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
@@ -30,9 +29,9 @@
|
||||
static VOID ColorHelp (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_COLOR_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_COLOR_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,24 +44,24 @@ VOID SetScreenColor (WORD wColor, BOOL bFill)
|
||||
|
||||
if ((wColor & 0xF) == (wColor &0xF0) >> 4)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_COLOR_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COLOR_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPuts(szMsg);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if (bFill == TRUE)
|
||||
{
|
||||
GetConsoleScreenBufferInfo (hConsole, &csbi);
|
||||
if (bFill == TRUE)
|
||||
{
|
||||
GetConsoleScreenBufferInfo (hConsole, &csbi);
|
||||
|
||||
coPos.X = 0;
|
||||
coPos.Y = 0;
|
||||
FillConsoleOutputAttribute (hConsole,
|
||||
(WORD)(wColor & 0x00FF),
|
||||
(csbi.dwSize.X)*(csbi.dwSize.Y),
|
||||
coPos,
|
||||
&dwWritten);
|
||||
}
|
||||
SetConsoleTextAttribute (hConsole, (WORD)(wColor & 0x00FF));
|
||||
coPos.X = 0;
|
||||
coPos.Y = 0;
|
||||
FillConsoleOutputAttribute (hConsole,
|
||||
(WORD)(wColor & 0x00FF),
|
||||
(csbi.dwSize.X)*(csbi.dwSize.Y),
|
||||
coPos,
|
||||
&dwWritten);
|
||||
}
|
||||
SetConsoleTextAttribute (hConsole, (WORD)(wColor & 0x00FF));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,26 +89,26 @@ INT CommandColor (LPTSTR first, LPTSTR rest)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (StringToColor (&wColor, &rest) == FALSE)
|
||||
if (StringToColor(&wColor, &rest) == FALSE)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_COLOR_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COLOR_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPuts(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_COLOR_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, wColor);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COLOR_ERROR3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, wColor);
|
||||
|
||||
if ((wColor & 0xF) == (wColor &0xF0) >> 4)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_COLOR_ERROR4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, wColor);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COLOR_ERROR4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, wColor);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set color */
|
||||
SetScreenColor (wColor,
|
||||
(_tcsstr (rest,_T("/F")) || _tcsstr (rest,_T("/f"))));
|
||||
SetScreenColor(wColor,
|
||||
(_tcsstr (rest,_T("/F")) || _tcsstr (rest,_T("/f"))));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* CONSOLE.C - console input/output functions.
|
||||
*
|
||||
*
|
||||
@@ -211,11 +210,11 @@ VOID ConPrintf(LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle)
|
||||
|
||||
VOID ConOutFormatMessage (DWORD MessageId, ...)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
DWORD ret;
|
||||
LPTSTR text;
|
||||
va_list arg_ptr;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
|
||||
va_start (arg_ptr, MessageId);
|
||||
ret = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
@@ -233,8 +232,8 @@ VOID ConOutFormatMessage (DWORD MessageId, ...)
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_CONSOLE_ERROR, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_CONSOLE_ERROR, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* COPY.C -- copy internal command.
|
||||
*
|
||||
*
|
||||
@@ -296,29 +295,26 @@ DeleteFileList (LPFILES f)
|
||||
static INT
|
||||
Overwrite (LPTSTR fn)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR inp[10];
|
||||
LPTSTR p;
|
||||
|
||||
LPTSTR lpOptions;
|
||||
TCHAR Options[3];
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szOptions[4];
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, Options,sizeof(Options)/sizeof(TCHAR));
|
||||
lpOptions = Options;
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, szOptions, 4);
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COPY_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
|
||||
ConInString (inp, 10);
|
||||
ConOutPuts (_T(""));
|
||||
ConInString(inp, 10);
|
||||
ConOutPuts(_T(""));
|
||||
|
||||
_tcsupr (inp);
|
||||
for (p = inp; _istspace (*p); p++)
|
||||
;
|
||||
|
||||
if (*p != lpOptions[0] && *p != lpOptions[2])
|
||||
if (*p != szOptions[0] && *p != szOptions[2])
|
||||
return 0;
|
||||
if (*p == lpOptions[2])
|
||||
if (*p == szOptions[2])
|
||||
return 2;
|
||||
|
||||
return 1;
|
||||
@@ -330,6 +326,7 @@ Overwrite (LPTSTR fn)
|
||||
|
||||
int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
FILETIME srctime;
|
||||
HANDLE hFileSrc;
|
||||
HANDLE hFileDest;
|
||||
@@ -339,7 +336,6 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
|
||||
DWORD dwWritten;
|
||||
DWORD i;
|
||||
BOOL bEof = FALSE;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("checking mode\n"));
|
||||
@@ -351,8 +347,8 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
|
||||
NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (hFileSrc == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, source);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, source);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -379,8 +375,8 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
|
||||
{
|
||||
if (!_tcscmp (dest, source))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, source);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COPY_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, source);
|
||||
|
||||
CloseHandle (hFileSrc);
|
||||
return 0;
|
||||
@@ -456,8 +452,8 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
|
||||
if (dwWritten != dwRead)
|
||||
{
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COPY_ERROR3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
|
||||
free (buffer);
|
||||
CloseHandle (hFileDest);
|
||||
@@ -633,12 +629,12 @@ SetupCopy (LPFILES sources, TCHAR **p, BOOL bMultiple,
|
||||
|
||||
INT cmd_copy (LPTSTR first, LPTSTR rest)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR **p;
|
||||
TCHAR drive_d[_MAX_DRIVE];
|
||||
TCHAR dir_d[_MAX_DIR];
|
||||
TCHAR file_d[_MAX_FNAME];
|
||||
TCHAR ext_d[_MAX_EXT];
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
int argc;
|
||||
int append;
|
||||
@@ -655,8 +651,8 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
|
||||
|
||||
if (!_tcsncmp (rest, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COPY_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -728,8 +724,8 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
|
||||
}
|
||||
else if (bDestFound && bWildcards)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_ERROR4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_COPY_ERROR4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
|
||||
DeleteFileList (sources);
|
||||
freep (p);
|
||||
|
||||
@@ -53,18 +53,18 @@ PrintDateString (VOID)
|
||||
{
|
||||
case 0: /* mmddyy */
|
||||
default:
|
||||
LoadString( GetModuleHandle(NULL), STRING_DATE_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, cDateSeparator, cDateSeparator);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DATE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
|
||||
break;
|
||||
|
||||
case 1: /* ddmmyy */
|
||||
LoadString( GetModuleHandle(NULL), STRING_DATE_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, cDateSeparator, cDateSeparator);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DATE_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
|
||||
break;
|
||||
|
||||
case 2: /* yymmdd */
|
||||
LoadString( GetModuleHandle(NULL), STRING_DATE_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, cDateSeparator, cDateSeparator);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DATE_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ ParseDate (LPTSTR s)
|
||||
break;
|
||||
}
|
||||
|
||||
/* if only entered two digits: */
|
||||
/* if only entered two digits: */
|
||||
/* assume 2000's if value less than 80 */
|
||||
/* assume 1900's if value greater or equal 80 */
|
||||
if (d.wYear <= 99)
|
||||
@@ -184,17 +184,17 @@ ParseDate (LPTSTR s)
|
||||
|
||||
INT cmd_date (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR *arg;
|
||||
INT argc;
|
||||
INT i;
|
||||
BOOL bPrompt = TRUE;
|
||||
INT nDateString = -1;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DATE_HELP4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts ((LPTSTR)szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DATE_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -247,14 +247,15 @@ INT cmd_date (LPTSTR cmd, LPTSTR param)
|
||||
freep (arg);
|
||||
return 0;
|
||||
}
|
||||
LoadString( GetModuleHandle(NULL), STRING_DATE_ERROR, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPuts (szMsg);
|
||||
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_DATE_ERROR, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPuts(szMsg);
|
||||
}
|
||||
|
||||
freep (arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* INCLUDE_CMD_DATE */
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -96,6 +96,7 @@ RemoveFile (LPTSTR lpFileName, DWORD dwFlags)
|
||||
|
||||
INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szFullPath[MAX_PATH];
|
||||
LPTSTR pFilePart;
|
||||
LPTSTR *arg = NULL;
|
||||
@@ -105,29 +106,14 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
INT nEvalArgs = 0; /* nunber of evaluated arguments */
|
||||
DWORD dwFlags = 0;
|
||||
DWORD dwFiles = 0;
|
||||
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA f;
|
||||
|
||||
LPTSTR lpOptions;
|
||||
TCHAR Options[11];
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LONG ch;
|
||||
|
||||
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_OPTION, Options,sizeof(Options)/sizeof(TCHAR));
|
||||
lpOptions = Options;
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg,
|
||||
lpOptions[2],Options[3],lpOptions[6],lpOptions[4],lpOptions[7],lpOptions[9],lpOptions[10],
|
||||
lpOptions[2],Options[3],lpOptions[6],lpOptions[4],lpOptions[7],lpOptions[9],lpOptions[10],
|
||||
lpOptions[2],Options[3],lpOptions[6],lpOptions[4],lpOptions[7],lpOptions[9],lpOptions[10],
|
||||
lpOptions[2],Options[3],lpOptions[6],lpOptions[4],lpOptions[7],lpOptions[9],lpOptions[10]
|
||||
);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -142,49 +128,39 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
if (_tcslen (arg[i]) >= 2)
|
||||
{
|
||||
|
||||
ch = _totupper (arg[i][1]);
|
||||
|
||||
if (_totupper (lpOptions[2]) == ch)
|
||||
{
|
||||
dwFlags |= DEL_NOTHING;
|
||||
}
|
||||
|
||||
else if (_totupper (lpOptions[3]) == ch)
|
||||
{
|
||||
dwFlags |= DEL_PROMPT;
|
||||
}
|
||||
|
||||
else if (_totupper (lpOptions[4]) == ch)
|
||||
{
|
||||
dwFlags |= DEL_QUIET;
|
||||
}
|
||||
|
||||
else if (_totupper (lpOptions[5]) == ch)
|
||||
{
|
||||
dwFlags |= DEL_SUBDIR;
|
||||
}
|
||||
|
||||
else if (_totupper (lpOptions[6]) == ch)
|
||||
{
|
||||
dwFlags |= DEL_TOTAL;
|
||||
}
|
||||
|
||||
else if (_totupper (lpOptions[7]) == ch)
|
||||
{
|
||||
dwFlags |= DEL_WIPE;
|
||||
}
|
||||
|
||||
else if (_totupper (lpOptions[9]) == ch)
|
||||
{
|
||||
dwFlags |= DEL_YES;
|
||||
}
|
||||
|
||||
else if (_totupper (lpOptions[10]) == ch)
|
||||
{
|
||||
dwFlags |= DEL_ZAP;
|
||||
}
|
||||
|
||||
ch = _totupper (arg[i][1]);
|
||||
if (ch == _T('N'))
|
||||
{
|
||||
dwFlags |= DEL_NOTHING;
|
||||
}
|
||||
else if (ch == _T('P'))
|
||||
{
|
||||
dwFlags |= DEL_PROMPT;
|
||||
}
|
||||
else if (ch == _T('Q'))
|
||||
{
|
||||
dwFlags |= DEL_QUIET;
|
||||
}
|
||||
else if (ch == _T('S'))
|
||||
{
|
||||
dwFlags |= DEL_SUBDIR;
|
||||
}
|
||||
else if (ch == _T('T'))
|
||||
{
|
||||
dwFlags |= DEL_TOTAL;
|
||||
}
|
||||
else if (ch == _T('W'))
|
||||
{
|
||||
dwFlags |= DEL_WIPE;
|
||||
}
|
||||
else if (ch == _T('Y'))
|
||||
{
|
||||
dwFlags |= DEL_YES;
|
||||
}
|
||||
else if (ch == _T('Z'))
|
||||
{
|
||||
dwFlags |= DEL_ZAP;
|
||||
}
|
||||
}
|
||||
|
||||
nEvalArgs++;
|
||||
@@ -211,11 +187,9 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
if (!((dwFlags & DEL_YES) || (dwFlags & DEL_QUIET) || (dwFlags & DEL_PROMPT)))
|
||||
{
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
|
||||
res = FilePromptYN (szMsg);
|
||||
|
||||
if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
|
||||
break;
|
||||
}
|
||||
@@ -231,8 +205,7 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
/* wildcards in filespec */
|
||||
#ifdef _DEBUG
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf ((LPTSTR)szMsg);
|
||||
ConErrPrintf(_T("Wildcards!\n\n"));
|
||||
#endif
|
||||
|
||||
GetFullPathName (arg[i],
|
||||
@@ -241,12 +214,8 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
&pFilePart);
|
||||
|
||||
#ifdef _DEBUG
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, szFullPath);
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (pFilePart);
|
||||
|
||||
ConErrPrintf(_T("Full path: %s\n"), szFullPath);
|
||||
ConErrPrintf(_T("File part: %s\n"), pFilePart);
|
||||
#endif
|
||||
|
||||
hFile = FindFirstFile (szFullPath, &f);
|
||||
@@ -268,18 +237,17 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
_tcscpy (pFilePart, f.cFileName);
|
||||
|
||||
#ifdef _DEBUG
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
ConErrPrintf(_T("Full filename: %s\n"), szFullPath);
|
||||
#endif
|
||||
|
||||
/* ask for deleting */
|
||||
if (dwFlags & DEL_PROMPT)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR5, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szFullPath);
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_ERROR5, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, szFullPath);
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR6, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
res = FilePromptYN (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_ERROR6, szMsg, RC_STRING_MAX_SIZE);
|
||||
res = FilePromptYN ((LPTSTR)szMsg);
|
||||
|
||||
if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
|
||||
{
|
||||
@@ -289,8 +257,8 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!(dwFlags & DEL_QUIET) && !(dwFlags & DEL_TOTAL))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR7, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, szFullPath);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_ERROR7, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, szFullPath);
|
||||
}
|
||||
|
||||
/* delete the file */
|
||||
@@ -334,22 +302,22 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
/* no wildcards in filespec */
|
||||
#ifdef _DEBUG
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR8, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
ConErrPrintf(_T("No Wildcards!\n"));
|
||||
#endif
|
||||
GetFullPathName (arg[i],
|
||||
MAX_PATH,
|
||||
szFullPath,
|
||||
&pFilePart);
|
||||
|
||||
/*ask for deleting */
|
||||
if((dwFlags & DEL_PROMPT) && (FindFirstFile(szFullPath, &f) != INVALID_HANDLE_VALUE)) //Don't ask if the file doesn't exist, the following code will make the error-msg
|
||||
/* ask for deleting */
|
||||
// Don't ask if the file doesn't exist, the following code will make the error-msg
|
||||
if((dwFlags & DEL_PROMPT) && (FindFirstFile(szFullPath, &f) != INVALID_HANDLE_VALUE))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR5, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, szFullPath);
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR6, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
res = FilePromptYN (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_ERROR5, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, szFullPath);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_ERROR6, szMsg, RC_STRING_MAX_SIZE);
|
||||
res = FilePromptYN ((LPTSTR)szMsg);
|
||||
|
||||
if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
|
||||
{
|
||||
@@ -358,13 +326,12 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, szFullPath);
|
||||
ConErrPrintf(_T("Full path: %s\n"), szFullPath);
|
||||
#endif
|
||||
if (!(dwFlags & DEL_QUIET) && !(dwFlags & DEL_TOTAL))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_ERROR7, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, szFullPath);
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_ERROR7, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, szFullPath);
|
||||
}
|
||||
|
||||
if (!(dwFlags & DEL_NOTHING))
|
||||
@@ -417,14 +384,14 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
if (dwFiles < 2)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DEL_HELP4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_DEL_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
}
|
||||
|
||||
ConOutPrintf (szMsg, dwFiles);
|
||||
|
||||
ConOutPrintf(szMsg, dwFiles);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
|
||||
INT CommandDelay (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
DWORD val;
|
||||
DWORD mul=1000;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (_tcsncmp (param, _T("/?"), 2) == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DELAY_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
return 0;
|
||||
LoadString(GetModuleHandle(NULL), STRING_DELAY_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (*param==0)
|
||||
@@ -42,7 +41,7 @@ INT CommandDelay (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
|
||||
val = _ttoi(param);
|
||||
Sleep(val*mul);
|
||||
Sleep(val * mul);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+425
-373
File diff suppressed because it is too large
Load Diff
@@ -137,16 +137,15 @@ INT GetDirectoryStackDepth (VOID)
|
||||
*/
|
||||
INT CommandPushd (LPTSTR first, LPTSTR rest)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR curPath[MAX_PATH];
|
||||
TCHAR newPath[MAX_PATH];
|
||||
BOOL bChangePath = FALSE;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp (rest, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DIRSTACK_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts ((LPTSTR)szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_DIRSTACK_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -172,14 +171,13 @@ INT CommandPushd (LPTSTR first, LPTSTR rest)
|
||||
*/
|
||||
INT CommandPopd (LPTSTR first, LPTSTR rest)
|
||||
{
|
||||
TCHAR szPath[MAX_PATH];
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szPath[MAX_PATH];
|
||||
|
||||
if (!_tcsncmp(rest, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DIRSTACK_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_DIRSTACK_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -200,14 +198,13 @@ INT CommandPopd (LPTSTR first, LPTSTR rest)
|
||||
*/
|
||||
INT CommandDirs (LPTSTR first, LPTSTR rest)
|
||||
{
|
||||
LPDIRENTRY lpDir;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPDIRENTRY lpDir;
|
||||
|
||||
if (!_tcsncmp(rest, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DIRSTACK_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_DIRSTACK_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -216,9 +213,8 @@ INT CommandDirs (LPTSTR first, LPTSTR rest)
|
||||
|
||||
if (lpDir == NULL)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_DIRSTACK_HELP4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_DIRSTACK_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* ECHO.C - internal echo commands.
|
||||
*
|
||||
*
|
||||
@@ -41,8 +40,8 @@ INT CommandEcho (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ECHO_HELP4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -61,15 +60,17 @@ INT CommandEcho (LPTSTR cmd, LPTSTR param)
|
||||
bEcho = TRUE;
|
||||
else if (*param)
|
||||
ConOutPuts (param);
|
||||
else {
|
||||
LoadString( GetModuleHandle(NULL), STRING_ECHO_HELP4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, bEcho ? D_ON : D_OFF);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, bEcho ? D_ON : D_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
INT CommandEchos (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
@@ -80,9 +81,8 @@ INT CommandEchos (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ECHO_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts(szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -103,9 +103,8 @@ INT CommandEchoerr (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ECHO_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts((LPTSTR)szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -124,6 +123,7 @@ INT CommandEchoerr (LPTSTR cmd, LPTSTR param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
INT CommandEchoserr (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
@@ -132,13 +132,10 @@ INT CommandEchoserr (LPTSTR cmd, LPTSTR param)
|
||||
DebugPrintf (_T("CommandEchoserr '%s' : '%s'\n"), cmd, param);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ECHO_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts(szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts((LPTSTR)szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,12 +42,12 @@
|
||||
|
||||
VOID ErrorMessage (DWORD dwErrorCode, LPTSTR szFormat, ...)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szMessage[1024];
|
||||
#ifndef __REACTOS__
|
||||
LPTSTR szError;
|
||||
#endif
|
||||
va_list arg_ptr;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (dwErrorCode == ERROR_SUCCESS)
|
||||
return;
|
||||
@@ -71,8 +71,8 @@ VOID ErrorMessage (DWORD dwErrorCode, LPTSTR szFormat, ...)
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, dwErrorCode);
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, dwErrorCode);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,21 +80,21 @@ VOID ErrorMessage (DWORD dwErrorCode, LPTSTR szFormat, ...)
|
||||
|
||||
switch (dwErrorCode)
|
||||
{
|
||||
case ERROR_FILE_NOT_FOUND:
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_FILE_NOT_FOUND, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
case ERROR_FILE_NOT_FOUND:
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_FILE_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
|
||||
break;
|
||||
|
||||
case ERROR_PATH_NOT_FOUND:
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_PATH_NOT_FOUND, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
|
||||
break;
|
||||
|
||||
case ERROR_NOT_READY:
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_DRIVER_NOT_READY, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_DRIVER_NOT_READY, szMsg, RC_STRING_MAX_SIZE);
|
||||
break;
|
||||
|
||||
default:
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -108,107 +108,121 @@ VOID ErrorMessage (DWORD dwErrorCode, LPTSTR szFormat, ...)
|
||||
VOID error_parameter_format(TCHAR ch)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_PARAMETERF_ERROR, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, ch);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_PARAMETERF_ERROR, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, ch);
|
||||
}
|
||||
|
||||
|
||||
VOID error_invalid_switch (TCHAR ch)
|
||||
{
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_INVALID_SWITCH, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, ch);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_INVALID_SWITCH, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, ch);
|
||||
}
|
||||
|
||||
|
||||
VOID error_too_many_parameters (LPTSTR s)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_TOO_MANY_PARAMETERS, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, s);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_TOO_MANY_PARAMETERS, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, s);
|
||||
}
|
||||
|
||||
|
||||
VOID error_path_not_found (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_PATH_NOT_FOUND, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
|
||||
|
||||
VOID error_file_not_found (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_FILE_NOT_FOUND, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf ((LPTSTR)szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_FILE_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
|
||||
|
||||
VOID error_sfile_not_found (LPTSTR f)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_FILE_NOT_FOUND, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (_T("%s - %s\n"), szMsg,f);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_FILE_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(_T("%s - %s\n"), szMsg, f);
|
||||
}
|
||||
|
||||
|
||||
VOID error_req_param_missing (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_REQ_PARAM_MISSING, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_REQ_PARAM_MISSING, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
|
||||
|
||||
VOID error_invalid_drive (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_INVALID_DRIVE, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_INVALID_DRIVE, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
|
||||
|
||||
VOID error_bad_command (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_BADCOMMAND, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_BADCOMMAND, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
|
||||
|
||||
VOID error_no_pipe (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_CANNOTPIPE, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_CANNOTPIPE, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
|
||||
|
||||
VOID error_out_of_memory (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_OUT_OF_MEMORY, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_OUT_OF_MEMORY, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
}
|
||||
|
||||
|
||||
VOID error_invalid_parameter_format (LPTSTR s)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_INVALID_PARAM_FORMAT, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, s);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_INVALID_PARAM_FORMAT, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, s);
|
||||
}
|
||||
|
||||
|
||||
VOID error_syntax (LPTSTR s)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
|
||||
if (s)
|
||||
ConErrPrintf (_T("%s - %s\n"),szMsg, s);
|
||||
ConErrPrintf(_T("%s - %s\n"), szMsg, s);
|
||||
else
|
||||
ConErrPrintf (_T("%s.\n"), szMsg );
|
||||
ConErrPrintf(_T("%s.\n"), szMsg);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +230,8 @@ VOID msg_pause (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_ERROR_D_PAUSEMSG, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_ERROR_D_PAUSEMSG, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -50,10 +50,10 @@
|
||||
|
||||
INT cmd_for (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPBATCH_CONTEXT lpNew;
|
||||
LPTSTR pp;
|
||||
TCHAR var;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("cmd_for (\'%s\', \'%s\'\n"), cmd, param);
|
||||
@@ -61,9 +61,8 @@ INT cmd_for (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_FOR_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts ((LPTSTR)szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_FOR_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -83,8 +82,8 @@ INT cmd_for (LPTSTR cmd, LPTSTR param)
|
||||
/* Check next element is 'IN' */
|
||||
if ((_tcsnicmp (param, _T("in"), 2) != 0) || !_istspace (*(param + 2)))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_FOR_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
error_syntax (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_FOR_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
error_syntax(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -95,9 +94,8 @@ INT cmd_for (LPTSTR cmd, LPTSTR param)
|
||||
/* Folowed by a '(', find also matching ')' */
|
||||
if ((*param != _T('(')) || (NULL == (pp = _tcsrchr (param, _T(')')))))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_FOR_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
error_syntax (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_FOR_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
error_syntax(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -110,8 +108,8 @@ INT cmd_for (LPTSTR cmd, LPTSTR param)
|
||||
/* Check DO follows */
|
||||
if ((_tcsnicmp (pp, _T("do"), 2) != 0) || !_istspace (*(pp + 2)))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_FOR_ERROR3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
error_syntax (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_FOR_ERROR3, szMsg, RC_STRING_MAX_SIZE);
|
||||
error_syntax(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -122,9 +120,8 @@ INT cmd_for (LPTSTR cmd, LPTSTR param)
|
||||
/* Check that command tail is not empty */
|
||||
if (*pp == _T('\0'))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_FOR_ERROR4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
error_syntax (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_FOR_ERROR4, szMsg, RC_STRING_MAX_SIZE);
|
||||
error_syntax(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ ConvertULargeInteger (ULARGE_INTEGER num, LPTSTR des, INT len)
|
||||
static VOID
|
||||
PrintDiskInfo (LPTSTR szDisk)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szRootPath[4] = _T("A:\\");
|
||||
TCHAR szDrive[2] = _T("A");
|
||||
TCHAR szVolume[64];
|
||||
@@ -71,14 +72,11 @@ PrintDiskInfo (LPTSTR szDisk)
|
||||
DWORD dwBytPerSec;
|
||||
DWORD dwFreeCl;
|
||||
DWORD dwTotCl;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (_tcslen (szDisk) < 2 || szDisk[1] != _T(':'))
|
||||
{
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_FREE_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_FREE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -88,16 +86,16 @@ PrintDiskInfo (LPTSTR szDisk)
|
||||
if (!GetVolumeInformation (szRootPath, szVolume, 64, &dwSerial,
|
||||
NULL, NULL, NULL, 0))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_FREE_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (_T("%s %s:\n"),szMsg, szDrive);
|
||||
LoadString(GetModuleHandle(NULL), STRING_FREE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(_T("%s %s:\n"), szMsg, szDrive);
|
||||
return;
|
||||
}
|
||||
|
||||
if (szVolume[0] == _T('\0'))
|
||||
{
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_FREE_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
_tcscpy (szVolume, szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_FREE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
_tcscpy (szVolume, szMsg);
|
||||
}
|
||||
|
||||
_stprintf (szSerial,
|
||||
@@ -108,8 +106,8 @@ PrintDiskInfo (LPTSTR szDisk)
|
||||
if (!GetDiskFreeSpace (szRootPath, &dwSecPerCl,
|
||||
&dwBytPerSec, &dwFreeCl, &dwTotCl))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_FREE_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (_T("%s %s:\n"),szMsg, szDrive);
|
||||
LoadString(GetModuleHandle(NULL), STRING_FREE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf (_T("%s %s:\n"), szMsg, szDrive);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -123,24 +121,23 @@ PrintDiskInfo (LPTSTR szDisk)
|
||||
ConvertULargeInteger (uliSize, szFree, 40);
|
||||
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_FREE_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg,szDrive, szVolume, szSerial,szTotal, szUsed, szFree);
|
||||
LoadString(GetModuleHandle(NULL), STRING_FREE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, szDrive, szVolume, szSerial, szTotal, szUsed, szFree);
|
||||
}
|
||||
|
||||
|
||||
INT CommandFree (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR szParam;
|
||||
TCHAR szDefPath[MAX_PATH];
|
||||
INT argc, i;
|
||||
LPTSTR *arg;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_FREE_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_FREE_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
|
||||
INT cmd_goto (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR tmp;
|
||||
LONG lNewPosHigh;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("cmd_goto (\'%s\', \'%s\'\n"), cmd, param);
|
||||
@@ -49,9 +49,8 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_GOTO_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_GOTO_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -63,9 +62,8 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (*param == _T('\0'))
|
||||
{
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_GOTO_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ExitBatch (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_GOTO_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ExitBatch(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -97,9 +95,11 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_GOTO_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg,param);
|
||||
ExitBatch (NULL);
|
||||
LoadString(GetModuleHandle(NULL), STRING_GOTO_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, param);
|
||||
ExitBatch(NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -120,7 +120,7 @@ INT CommandHistory (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
else
|
||||
{
|
||||
for(h_tmp=Top->prev;h_tmp!=Bottom;h_tmp=h_tmp->prev)
|
||||
for (h_tmp = Top->prev; h_tmp != Bottom; h_tmp = h_tmp->prev)
|
||||
ConErrPuts(h_tmp->string);
|
||||
}
|
||||
return 0;
|
||||
@@ -128,11 +128,9 @@ INT CommandHistory (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
VOID set_size(INT new_size)
|
||||
{
|
||||
|
||||
while(new_size<size)
|
||||
while (new_size<size)
|
||||
del(Top->prev);
|
||||
|
||||
|
||||
|
||||
max_size=new_size;
|
||||
}
|
||||
|
||||
@@ -140,19 +138,16 @@ VOID set_size(INT new_size)
|
||||
VOID InitHistory(VOID)
|
||||
{
|
||||
size=0;
|
||||
|
||||
|
||||
Top = malloc(sizeof(HIST_ENTRY));
|
||||
Bottom = malloc(sizeof(HIST_ENTRY));
|
||||
|
||||
Top = malloc(sizeof(HIST_ENTRY));
|
||||
Bottom = malloc(sizeof(HIST_ENTRY));
|
||||
|
||||
Top->prev = Bottom;
|
||||
Top->next = NULL;
|
||||
Top->string = NULL;
|
||||
|
||||
|
||||
Bottom->prev = NULL;
|
||||
Bottom->next = Top;
|
||||
Bottom->next = Top;
|
||||
Bottom->string = NULL;
|
||||
|
||||
curr_ptr=Bottom;
|
||||
@@ -163,49 +158,44 @@ VOID InitHistory(VOID)
|
||||
|
||||
VOID CleanHistory(VOID)
|
||||
{
|
||||
|
||||
while (Bottom->next!=Top)
|
||||
del(Bottom->next);
|
||||
|
||||
free(Top);
|
||||
free(Bottom);
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID History_del_current_entry(LPTSTR str)
|
||||
{
|
||||
LPHIST_ENTRY tmp;
|
||||
|
||||
if (size==0)
|
||||
|
||||
if (size == 0)
|
||||
return;
|
||||
|
||||
if(curr_ptr==Bottom)
|
||||
if (curr_ptr == Bottom)
|
||||
curr_ptr=Bottom->next;
|
||||
|
||||
if(curr_ptr==Top)
|
||||
if (curr_ptr == Top)
|
||||
curr_ptr=Top->prev;
|
||||
|
||||
|
||||
tmp=curr_ptr;
|
||||
curr_ptr=curr_ptr->prev;
|
||||
tmp = curr_ptr;
|
||||
curr_ptr = curr_ptr->prev;
|
||||
del(tmp);
|
||||
History(-1,str);
|
||||
|
||||
History(-1, str);
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
VOID del(LPHIST_ENTRY item)
|
||||
{
|
||||
|
||||
if( item==NULL || item==Top || item==Bottom )
|
||||
if (item==NULL || item==Top || item==Bottom)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf(_T("del in " __FILE__ ": retrning\n"
|
||||
"item is 0x%08x (Bottom is0x%08x)\n"),
|
||||
item, Bottom);
|
||||
|
||||
item, Bottom);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -215,10 +205,6 @@ VOID del(LPHIST_ENTRY item)
|
||||
/*free string's mem*/
|
||||
if (item->string)
|
||||
free(item->string);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*set links in prev and next item*/
|
||||
item->next->prev=item->prev;
|
||||
@@ -227,17 +213,15 @@ VOID del(LPHIST_ENTRY item)
|
||||
free(item);
|
||||
|
||||
size--;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static
|
||||
VOID add_before_last(LPTSTR string)
|
||||
{
|
||||
|
||||
{
|
||||
LPHIST_ENTRY tmp,before,after;
|
||||
|
||||
|
||||
/*delete first entry if maximum number of entries is reached*/
|
||||
while(size>=max_size)
|
||||
del(Top->prev);
|
||||
@@ -248,14 +232,11 @@ VOID add_before_last(LPTSTR string)
|
||||
if (*string==_T('\0'))
|
||||
return;
|
||||
|
||||
|
||||
|
||||
/*allocte entry and string*/
|
||||
tmp=malloc(sizeof(HIST_ENTRY));
|
||||
tmp->string=malloc((_tcslen(string)+1)*sizeof(TCHAR));
|
||||
_tcscpy(tmp->string,string);
|
||||
|
||||
|
||||
_tcscpy(tmp->string,string);
|
||||
|
||||
/*set links*/
|
||||
before=Bottom->next;
|
||||
after=before->next;
|
||||
@@ -266,12 +247,6 @@ VOID add_before_last(LPTSTR string)
|
||||
after->prev=tmp;
|
||||
before->next=tmp;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*set new size*/
|
||||
size++;
|
||||
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
|
||||
INT cmd_if (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
INT x_flag = 0; /* when set cause 'then' clause to be executed */
|
||||
LPTSTR pp;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("cmd_if: (\'%S\', \'%S\')\n"), cmd, param);
|
||||
@@ -49,7 +49,7 @@ INT cmd_if (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_IF_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_IF_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
@@ -90,10 +90,9 @@ INT cmd_if (LPTSTR cmd, LPTSTR param)
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check for 'defined' form */
|
||||
else if (!_tcsnicmp (param, _T("defined"), 7) && _istspace (*(param + 7)))
|
||||
{
|
||||
/* Check for 'defined' form */
|
||||
TCHAR Value [1];
|
||||
INT ValueSize = 0;
|
||||
|
||||
@@ -121,10 +120,9 @@ INT cmd_if (LPTSTR cmd, LPTSTR param)
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check for 'errorlevel' form */
|
||||
else if (!_tcsnicmp (param, _T("errorlevel"), 10) && _istspace (*(param + 10)))
|
||||
{
|
||||
/* Check for 'errorlevel' form */
|
||||
INT n = 0;
|
||||
|
||||
pp = param + 10;
|
||||
@@ -138,14 +136,12 @@ INT cmd_if (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
x_flag |= X_EMPTY; /* Syntax error if comd empty */
|
||||
}
|
||||
|
||||
/* Check that '==' is present, syntax error if not */
|
||||
else if (NULL == (pp = _tcsstr (param, _T("=="))))
|
||||
{
|
||||
/* Check that '==' is present, syntax error if not */
|
||||
error_syntax (NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* Change first '='to space to terminate comparison loop */
|
||||
@@ -193,3 +189,5 @@ INT cmd_if (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -154,19 +154,19 @@ VOID FreeLastPath (VOID)
|
||||
*/
|
||||
INT cmd_chdir (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR dir; /* pointer to the directory to change to */
|
||||
LPTSTR lpOldPath;
|
||||
LPTSTR endofstring; /* pointer to the null character in the directory to change to */
|
||||
LPTSTR lastquote; /* pointer to the last quotation mark in the directory to change to */
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
/*Should we better declare a variable containing _tsclen(dir) ? It's used a few times,
|
||||
but on the other hand paths are generally not very long*/
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_CD_HELP, szMsg, sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_CD_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -190,10 +190,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
|
||||
TCHAR szPath[MAX_PATH];
|
||||
|
||||
GetCurrentDirectory (MAX_PATH, szPath);
|
||||
|
||||
ConOutPuts (szPath);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -275,17 +272,16 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
|
||||
*/
|
||||
INT cmd_mkdir (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR dir; /* pointer to the directory to change to */
|
||||
LPTSTR place; /* used to search for the \ when no space is used */
|
||||
LPTSTR *p = NULL;
|
||||
INT argc;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_MKDIR_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_MKDIR_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -320,8 +316,8 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!dir)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_PARAM_ERROR, szMsg, sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString( GetModuleHandle(NULL), STRING_PARAM_ERROR, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConErrPrintf (_T((LPTSTR)szMsg));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -351,21 +347,17 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param)
|
||||
*/
|
||||
INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR dir; /* pointer to the directory to change to */
|
||||
LPTSTR place; /* used to search for the \ when no space is used */
|
||||
|
||||
LPTSTR *p = NULL;
|
||||
INT argc;
|
||||
|
||||
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_RMDIR_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_RMDIR_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -399,9 +391,8 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!dir)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_PARAM_ERROR, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_PARAM_ERROR, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -434,8 +425,8 @@ INT CommandExit (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_EXIT_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_EXIT_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -455,8 +446,8 @@ INT CommandRem (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_REM_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_REM_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
|
||||
INT cmd_label (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szRootPath[] = _T("A:\\");
|
||||
TCHAR szLabel[80];
|
||||
TCHAR szOldLabel[80];
|
||||
DWORD dwSerialNr;
|
||||
LPTSTR *arg;
|
||||
INT args;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
/* set empty label string */
|
||||
szLabel[0] = _T('\0');
|
||||
@@ -39,9 +39,8 @@ INT cmd_label (LPTSTR cmd, LPTSTR param)
|
||||
/* print help */
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_LABEL_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_LABEL_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -88,40 +87,40 @@ INT cmd_label (LPTSTR cmd, LPTSTR param)
|
||||
return 1;
|
||||
}
|
||||
|
||||
GetVolumeInformation (szRootPath, szOldLabel, 80, &dwSerialNr,
|
||||
NULL, NULL, NULL, 0);
|
||||
GetVolumeInformation(szRootPath, szOldLabel, 80, &dwSerialNr,
|
||||
NULL, NULL, NULL, 0);
|
||||
|
||||
/* print drive info */
|
||||
if (szOldLabel[0] != _T('\0'))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_LABEL_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, _totupper (szRootPath[0]), szOldLabel);
|
||||
LoadString(GetModuleHandle(NULL), STRING_LABEL_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, _totupper(szRootPath[0]), szOldLabel);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_LABEL_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, _totupper (szRootPath[0]));
|
||||
LoadString(GetModuleHandle(NULL), STRING_LABEL_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, _totupper(szRootPath[0]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* print the volume serial number */
|
||||
LoadString( GetModuleHandle(NULL), STRING_LABEL_HELP4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
|
||||
LoadString(GetModuleHandle(NULL), STRING_LABEL_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
|
||||
|
||||
if (szLabel[0] == _T('\0'))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_LABEL_HELP5, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg);
|
||||
|
||||
ConInString (szLabel, 80);
|
||||
LoadString(GetModuleHandle(NULL), STRING_LABEL_HELP5, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
|
||||
ConInString(szLabel, 80);
|
||||
}
|
||||
|
||||
SetVolumeLabel (szRootPath, szLabel);
|
||||
SetVolumeLabel(szRootPath, szLabel);
|
||||
|
||||
freep (arg);
|
||||
freep(arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* INCLUDE_CMD_LABEL */
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -33,32 +33,24 @@ VOID InitLocale (VOID)
|
||||
|
||||
/* date settings */
|
||||
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SDATE, szBuffer, 256);
|
||||
#if !defined(_UNICODE) && !defined(UNICODE)
|
||||
CharToOem (szBuffer, szBuffer);
|
||||
#endif
|
||||
CharToOem (szBuffer, szBuffer);
|
||||
cDateSeparator = szBuffer[0];
|
||||
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_IDATE, szBuffer, 256);
|
||||
nDateFormat = _ttoi (szBuffer);
|
||||
|
||||
/* time settings */
|
||||
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_STIME, szBuffer, 256);
|
||||
#if !defined(_UNICODE) && !defined(UNICODE)
|
||||
CharToOem (szBuffer, szBuffer);
|
||||
#endif
|
||||
cTimeSeparator = szBuffer[0];
|
||||
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_ITIME, szBuffer, 256);
|
||||
nTimeFormat = _ttoi (szBuffer);
|
||||
|
||||
/* number settings */
|
||||
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, szBuffer, 256);
|
||||
#if !defined(_UNICODE) && !defined(UNICODE)
|
||||
CharToOem (szBuffer, szBuffer);
|
||||
#endif
|
||||
cThousandSeparator = szBuffer[0];
|
||||
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szBuffer, 256);
|
||||
#if !defined(_UNICODE) && !defined(UNICODE)
|
||||
CharToOem (szBuffer, szBuffer);
|
||||
#endif
|
||||
cDecimalSeparator = szBuffer[0];
|
||||
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SGROUPING, szBuffer, 256);
|
||||
nNumberGroups = _ttoi (szBuffer);
|
||||
@@ -67,9 +59,7 @@ VOID InitLocale (VOID)
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME1 + i, szBuffer, 256);
|
||||
#if !defined(_UNICODE) && !defined(UNICODE)
|
||||
CharToOem (szBuffer, szBuffer);
|
||||
#endif
|
||||
_tcscpy (aszDayNames[(i+1)%7], szBuffer); /* little hack */
|
||||
}
|
||||
#endif
|
||||
@@ -93,11 +83,11 @@ VOID InitLocale (VOID)
|
||||
|
||||
/* days of week */
|
||||
for (i = 0; i < 7; i++)
|
||||
_tcscpy (aszDayNames[i], names[i]);
|
||||
_tcscpy(aszDayNames[i], names[i]);
|
||||
#endif
|
||||
|
||||
#ifdef LOCALE_DEFAULT
|
||||
LPTSTR names [7] = {_T("Sun"), _T("Mon"), _T("Tue"), _T("Wed"), _T("Thu"), _T("Fri"), _T("Sat")};
|
||||
LPTSTR names [7] = {_T("Sun"), _T("Mon"), _T("Tue"), _T("Wed"), _T("Thu"), _T("Fri"), _T("Sat")};
|
||||
INT i;
|
||||
|
||||
/* date settings */
|
||||
@@ -131,63 +121,63 @@ VOID PrintDate (VOID)
|
||||
{
|
||||
case 0: /* mmddyy */
|
||||
default:
|
||||
ConOutPrintf (_T("%s %02d%c%02d%c%04d"),
|
||||
aszDayNames[st.wDayOfWeek], st.wMonth, cDateSeparator, st.wDay, cDateSeparator, st.wYear);
|
||||
ConOutPrintf(_T("%s %02d%c%02d%c%04d"),
|
||||
aszDayNames[st.wDayOfWeek], st.wMonth, cDateSeparator, st.wDay, cDateSeparator, st.wYear);
|
||||
break;
|
||||
|
||||
case 1: /* ddmmyy */
|
||||
ConOutPrintf (_T("%s %02d%c%02d%c%04d"),
|
||||
aszDayNames[st.wDayOfWeek], st.wDay, cDateSeparator, st.wMonth, cDateSeparator, st.wYear);
|
||||
ConOutPrintf(_T("%s %02d%c%02d%c%04d"),
|
||||
aszDayNames[st.wDayOfWeek], st.wDay, cDateSeparator, st.wMonth, cDateSeparator, st.wYear);
|
||||
break;
|
||||
|
||||
case 2: /* yymmdd */
|
||||
ConOutPrintf (_T("%s %04d%c%02d%c%02d"),
|
||||
aszDayNames[st.wDayOfWeek], st.wYear, cDateSeparator, st.wMonth, cDateSeparator, st.wDay);
|
||||
ConOutPrintf(_T("%s %04d%c%02d%c%02d"),
|
||||
aszDayNames[st.wDayOfWeek], st.wYear, cDateSeparator, st.wMonth, cDateSeparator, st.wDay);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
TCHAR szDate[32];
|
||||
|
||||
GetDateFormat (LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL,
|
||||
szDate, sizeof (szDate));
|
||||
ConOutPrintf (_T("%s"), szDate);
|
||||
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL,
|
||||
szDate, sizeof (szDate));
|
||||
ConOutPrintf(_T("%s"), szDate);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID PrintTime (VOID)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
#ifdef __REACTOS__
|
||||
SYSTEMTIME st;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
GetLocalTime (&st);
|
||||
GetLocalTime(&st);
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_LOCALE_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_LOCALE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
|
||||
switch (nTimeFormat)
|
||||
{
|
||||
case 0: /* 12 hour format */
|
||||
default:
|
||||
ConOutPrintf (_T("%s %2d%c%02d%c%02d%c%02d%c\n"),szMsg,
|
||||
(st.wHour == 0 ? 12 : (st.wHour <= 12 ? st.wHour : st.wHour - 12)),
|
||||
cTimeSeparator, st.wMinute, cTimeSeparator, st.wSecond, cDecimalSeparator,
|
||||
st.wMilliseconds / 10, (st.wHour <= 11 ? 'a' : 'p'));
|
||||
default:
|
||||
ConOutPrintf(_T("%s %2d%c%02d%c%02d%c%02d%c\n"), szMsg,
|
||||
(st.wHour == 0 ? 12 : (st.wHour <= 12 ? st.wHour : st.wHour - 12)),
|
||||
cTimeSeparator, st.wMinute, cTimeSeparator, st.wSecond, cDecimalSeparator,
|
||||
st.wMilliseconds / 10, (st.wHour <= 11 ? _T('a') : _T('p')));
|
||||
break;
|
||||
|
||||
case 1: /* 24 hour format */
|
||||
ConOutPrintf (_T("%s %2d%c%02d%c%02d%c%02d\n"),szMsg,
|
||||
st.wHour, cTimeSeparator, st.wMinute, cTimeSeparator,
|
||||
st.wSecond, cDecimalSeparator, st.wMilliseconds / 10);
|
||||
ConOutPrintf(_T("%s %2d%c%02d%c%02d%c%02d\n"), szMsg,
|
||||
st.wHour, cTimeSeparator, st.wMinute, cTimeSeparator,
|
||||
st.wSecond, cDecimalSeparator, st.wMilliseconds / 10);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
TCHAR szTime[32];
|
||||
TCHAR szTime[32];
|
||||
|
||||
GetTimeFormat (LOCALE_USER_DEFAULT, 0, NULL, NULL,
|
||||
szTime, sizeof (szTime));
|
||||
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL,
|
||||
szTime, sizeof(szTime));
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_LOCALE_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (_T("%s: %s\n"),(LPTSTR)szMsg, szTime);
|
||||
LoadString(GetModuleHandle(NULL), STRING_LOCALE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(_T("%s: %s\n"), szMsg, szTime);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ ConvertDWord (DWORD num, LPTSTR des, INT len, BOOL bSeparator)
|
||||
|
||||
INT CommandMemory (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
MEMORYSTATUS ms;
|
||||
TCHAR szMemoryLoad[20];
|
||||
TCHAR szTotalPhys[20];
|
||||
@@ -64,12 +65,11 @@ INT CommandMemory (LPTSTR cmd, LPTSTR param)
|
||||
TCHAR szAvailPageFile[20];
|
||||
TCHAR szTotalVirtual[20];
|
||||
TCHAR szAvailVirtual[20];
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_MEMMORY_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MEMMORY_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -85,10 +85,10 @@ INT CommandMemory (LPTSTR cmd, LPTSTR param)
|
||||
ConvertDWord (ms.dwTotalVirtual, szTotalVirtual, 20, TRUE);
|
||||
ConvertDWord (ms.dwAvailVirtual, szAvailVirtual, 20, TRUE);
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_MEMMORY_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg,
|
||||
szMemoryLoad, szTotalPhys, szAvailPhys, szTotalPageFile,
|
||||
szAvailPageFile, szTotalVirtual, szAvailVirtual);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MEMMORY_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg,
|
||||
szMemoryLoad, szTotalPhys, szAvailPhys, szTotalPageFile,
|
||||
szAvailPageFile, szTotalVirtual, szAvailVirtual);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ BOOL FileGetString (HANDLE hFile, LPTSTR lpBuffer, INT nBufferLength)
|
||||
ReadFile (hFile, &ch, 1, &dwRead, NULL);
|
||||
break;
|
||||
}
|
||||
lpString[len++] = ch;
|
||||
lpString[len++] = ch;
|
||||
}
|
||||
|
||||
if (!dwRead && !len)
|
||||
@@ -437,11 +437,11 @@ HWND GetConsoleWindow (VOID)
|
||||
|
||||
INT PagePrompt (VOID)
|
||||
{
|
||||
INPUT_RECORD ir;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
INPUT_RECORD ir;
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_MISC_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf(szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MISC_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
|
||||
RemoveBreakHandler ();
|
||||
ConInDisable ();
|
||||
@@ -468,39 +468,35 @@ INT PagePrompt (VOID)
|
||||
|
||||
INT FilePromptYN (LPTSTR szFormat, ...)
|
||||
{
|
||||
TCHAR szOut[512];
|
||||
va_list arg_ptr;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szOut[512];
|
||||
va_list arg_ptr;
|
||||
// TCHAR cKey = 0;
|
||||
// LPTSTR szKeys = _T("yna");
|
||||
|
||||
// TCHAR cKey = 0;
|
||||
// LPTSTR szKeys = _T("yna");
|
||||
|
||||
TCHAR szIn[10];
|
||||
TCHAR szIn[10];
|
||||
LPTSTR p;
|
||||
|
||||
va_start (arg_ptr, szFormat);
|
||||
_vstprintf (szOut, szFormat, arg_ptr);
|
||||
va_end (arg_ptr);
|
||||
|
||||
ConOutPrintf (szFormat);
|
||||
ConOutPrintf (szFormat);
|
||||
|
||||
/* preliminary fix */
|
||||
ConInString (szIn, 10);
|
||||
ConOutPrintf (_T("\n"));
|
||||
/* preliminary fix */
|
||||
ConInString (szIn, 10);
|
||||
ConOutPrintf (_T("\n"));
|
||||
|
||||
_tcsupr (szIn);
|
||||
for (p = szIn; _istspace (*p); p++);
|
||||
_tcsupr (szIn);
|
||||
for (p = szIn; _istspace (*p); p++)
|
||||
;
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_CHOICE_OPTION, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_CHOICE_OPTION, szMsg, RC_STRING_MAX_SIZE);
|
||||
|
||||
|
||||
if (_tcsncmp(p,&szMsg[0],1)==0)
|
||||
return PROMPT_YES;
|
||||
else if (_tcsncmp(p,&szMsg[1],1)==0)
|
||||
return PROMPT_NO;
|
||||
|
||||
|
||||
if (_tcsncmp(p, &szMsg[0], 1) == 0)
|
||||
return PROMPT_YES;
|
||||
else if (_tcsncmp(p, &szMsg[1], 1) == 0)
|
||||
return PROMPT_NO;
|
||||
#if 0
|
||||
else if (*p == _T('\03'))
|
||||
return PROMPT_BREAK;
|
||||
@@ -509,7 +505,7 @@ INT FilePromptYN (LPTSTR szFormat, ...)
|
||||
return PROMPT_NO;
|
||||
|
||||
|
||||
/* unfinished sollution */
|
||||
/* unfinished sollution */
|
||||
#if 0
|
||||
RemoveBreakHandler ();
|
||||
ConInDisable ();
|
||||
@@ -517,9 +513,9 @@ INT FilePromptYN (LPTSTR szFormat, ...)
|
||||
do
|
||||
{
|
||||
ConInKey (&ir);
|
||||
cKey = _totlower (ir.Event.KeyEvent.uChar.AsciiChar);
|
||||
if (_tcschr (szKeys, cKey[0]) == NULL)
|
||||
cKey = 0;
|
||||
cKey = _totlower (ir.Event.KeyEvent.uChar.AsciiChar);
|
||||
if (_tcschr (szKeys, cKey[0]) == NULL)
|
||||
cKey = 0;
|
||||
|
||||
|
||||
}
|
||||
@@ -542,38 +538,37 @@ INT FilePromptYN (LPTSTR szFormat, ...)
|
||||
|
||||
INT FilePromptYNA (LPTSTR szFormat, ...)
|
||||
{
|
||||
TCHAR szOut[512];
|
||||
va_list arg_ptr;
|
||||
// TCHAR cKey = 0;
|
||||
// LPTSTR szKeys = _T("yna");
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
TCHAR szOut[512];
|
||||
va_list arg_ptr;
|
||||
// TCHAR cKey = 0;
|
||||
// LPTSTR szKeys = _T("yna");
|
||||
|
||||
TCHAR szIn[10];
|
||||
TCHAR szIn[10];
|
||||
LPTSTR p;
|
||||
|
||||
va_start (arg_ptr, szFormat);
|
||||
_vstprintf (szOut, szFormat, arg_ptr);
|
||||
va_end (arg_ptr);
|
||||
|
||||
ConOutPrintf (szFormat);
|
||||
ConOutPrintf (szFormat);
|
||||
|
||||
/* preliminary fix */
|
||||
ConInString (szIn, 10);
|
||||
ConOutPrintf (_T("\n"));
|
||||
/* preliminary fix */
|
||||
ConInString (szIn, 10);
|
||||
ConOutPrintf (_T("\n"));
|
||||
|
||||
_tcsupr (szIn);
|
||||
for (p = szIn; _istspace (*p); p++);
|
||||
_tcsupr (szIn);
|
||||
for (p = szIn; _istspace (*p); p++)
|
||||
;
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, szMsg, RC_STRING_MAX_SIZE);
|
||||
|
||||
if (_tcsncmp(p,&szMsg[0],1)==0)
|
||||
return PROMPT_YES;
|
||||
else if (_tcsncmp(p,&szMsg[1],1)==0)
|
||||
return PROMPT_NO;
|
||||
else if (_tcsncmp(p,&szMsg[2],1)==0)
|
||||
return PROMPT_ALL;
|
||||
if (_tcsncmp(p, &szMsg[0], 1) == 0)
|
||||
return PROMPT_YES;
|
||||
else if (_tcsncmp(p, &szMsg[1], 1) == 0)
|
||||
return PROMPT_NO;
|
||||
else if (_tcsncmp(p, &szMsg[2], 1) == 0)
|
||||
return PROMPT_ALL;
|
||||
|
||||
#if 0
|
||||
else if (*p == _T('\03'))
|
||||
@@ -591,11 +586,9 @@ INT FilePromptYNA (LPTSTR szFormat, ...)
|
||||
do
|
||||
{
|
||||
ConInKey (&ir);
|
||||
cKey = _totlower (ir.Event.KeyEvent.uChar.AsciiChar);
|
||||
if (_tcschr (szKeys, cKey[0]) == NULL)
|
||||
cKey = 0;
|
||||
|
||||
|
||||
cKey = _totlower (ir.Event.KeyEvent.uChar.AsciiChar);
|
||||
if (_tcschr (szKeys, cKey[0]) == NULL)
|
||||
cKey = 0;
|
||||
}
|
||||
while ((ir.Event.KeyEvent.wVirtualKeyCode == VK_SHIFT) ||
|
||||
(ir.Event.KeyEvent.wVirtualKeyCode == VK_MENU) ||
|
||||
|
||||
@@ -39,21 +39,21 @@
|
||||
|
||||
static INT Overwrite (LPTSTR fn)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR inp[10];
|
||||
LPTSTR p;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_MOVE_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, fn);
|
||||
ConInString (inp, 10);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MOVE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, fn);
|
||||
ConInString(inp, 10);
|
||||
|
||||
_tcsupr (inp);
|
||||
for (p=inp; _istspace (*p); p++)
|
||||
for (p = inp; _istspace(*p); p++)
|
||||
;
|
||||
|
||||
if (*p != _T('Y') && *p != _T('A'))
|
||||
if (*p != szMsg[0] && *p != szMsg[2])
|
||||
return OVERWRITE_NO;
|
||||
if (*p == _T('A'))
|
||||
if (*p == szMsg[2])
|
||||
return OVERWRITE_ALL;
|
||||
|
||||
return OVERWRITE_YES;
|
||||
@@ -63,6 +63,7 @@ static INT Overwrite (LPTSTR fn)
|
||||
|
||||
INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR *arg;
|
||||
INT argc, i, nFiles;
|
||||
TCHAR szDestPath[MAX_PATH];
|
||||
@@ -72,8 +73,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||
WIN32_FIND_DATA findBuffer;
|
||||
HANDLE hFile;
|
||||
LPTSTR pszFile;
|
||||
BOOL bNothing = FALSE;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
BOOL bNothing = FALSE;
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
@@ -92,8 +92,8 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||
" /-Y\n"
|
||||
"..."));
|
||||
#else
|
||||
LoadString( GetModuleHandle(NULL), STRING_MOVE_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MOVE_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -101,8 +101,6 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||
arg = split (param, &argc, FALSE);
|
||||
nFiles = argc;
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
|
||||
/* read options */
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
@@ -114,14 +112,14 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||
if (*p == _T('-'))
|
||||
{
|
||||
p++;
|
||||
if (_totupper (*p) == szMsg[0])
|
||||
if (_totupper (*p) == _T('Y'))
|
||||
bPrompt = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_totupper (*p) == szMsg[0])
|
||||
if (_totupper (*p) == _T('Y'))
|
||||
bPrompt = FALSE;
|
||||
else if (_totupper (*p) == szMsg[1])
|
||||
else if (_totupper (*p) == _T('N'))
|
||||
bNothing = TRUE;
|
||||
}
|
||||
nFiles--;
|
||||
@@ -194,11 +192,10 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||
if (!bNothing)
|
||||
{
|
||||
if (MoveFile (szSrcPath, szFullDestPath))
|
||||
LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_MOVE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
else
|
||||
LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
|
||||
ConOutPrintf ((LPTSTR)szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MOVE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -218,10 +215,10 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||
if (!bNothing)
|
||||
{
|
||||
if (MoveFile (szSrcPath, szDestPath))
|
||||
LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_MOVE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
else
|
||||
LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf ((LPTSTR)szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MOVE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,10 +235,10 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||
if (!bNothing)
|
||||
{
|
||||
if (MoveFile (szSrcPath, szFullDestPath))
|
||||
LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
else
|
||||
LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf ((LPTSTR)szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MOVE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
else
|
||||
LoadString(GetModuleHandle(NULL), STRING_MOVE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
INT CommandMsgbox (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
//used to parse command line
|
||||
LPTSTR tmp;
|
||||
|
||||
@@ -32,20 +34,19 @@ INT CommandMsgbox (LPTSTR cmd, LPTSTR param)
|
||||
//and to find window handle to pass to MessageBox
|
||||
HWND hWnd;
|
||||
TCHAR buff[128];
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
//these are MessabeBox() parameters
|
||||
LPTSTR title, prompt="";
|
||||
UINT uType=U_TYPE_INIT;
|
||||
LPTSTR title, prompt = "";
|
||||
UINT uType = U_TYPE_INIT;
|
||||
|
||||
//set default title to window title
|
||||
GetConsoleTitle(buff,128);
|
||||
/* set default title to window title */
|
||||
GetConsoleTitle(buff, 128);
|
||||
title = buff;
|
||||
|
||||
if (_tcsncmp (param, _T("/?"), 2) == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_MSGBOX_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts(szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_MSGBOX_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -56,27 +57,28 @@ INT CommandMsgbox (LPTSTR cmd, LPTSTR param)
|
||||
param++;
|
||||
|
||||
//search for type of messagebox (ok, okcancel, ...)
|
||||
if (_tcsnicmp(param, _T("ok "),3 ) == 0)
|
||||
{
|
||||
if (_tcsnicmp(param, _T("ok "), 3) == 0)
|
||||
{
|
||||
uType |= MB_ICONEXCLAMATION | MB_OK;
|
||||
param+=3;
|
||||
param += 3;
|
||||
}
|
||||
else if (_tcsnicmp(param, _T("okcancel "),9 ) == 0)
|
||||
else if (_tcsnicmp(param, _T("okcancel "), 9) == 0)
|
||||
{
|
||||
uType |= MB_ICONQUESTION | MB_OKCANCEL;
|
||||
param+=9;
|
||||
param += 9;
|
||||
}
|
||||
else if (_tcsnicmp(param, _T("yesno "),6 ) == 0)
|
||||
else if (_tcsnicmp(param, _T("yesno "), 6) == 0)
|
||||
{
|
||||
uType |= MB_ICONQUESTION | MB_YESNO;
|
||||
param+=6;
|
||||
param += 6;
|
||||
}
|
||||
else if (_tcsnicmp(param, _T("yesnocancel "), 12 ) == 0)
|
||||
else if (_tcsnicmp(param, _T("yesnocancel "), 12) == 0)
|
||||
{
|
||||
uType |= MB_ICONQUESTION | MB_YESNOCANCEL;
|
||||
param+=12;
|
||||
param += 12;
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
#ifdef _SYNTAX_CHECK
|
||||
error_req_param_missing ();
|
||||
return 1;
|
||||
@@ -93,7 +95,7 @@ INT CommandMsgbox (LPTSTR cmd, LPTSTR param)
|
||||
#ifdef _SYNTAX_CHECK
|
||||
//if reached end of string
|
||||
//it is an error becuase we do not yet have prompt
|
||||
if ( *param == 0)
|
||||
if (*param == 0)
|
||||
{
|
||||
error_req_param_missing ();
|
||||
return 1;
|
||||
@@ -103,24 +105,25 @@ INT CommandMsgbox (LPTSTR cmd, LPTSTR param)
|
||||
//search for "title"
|
||||
tmp = param;
|
||||
|
||||
if(*param == '"')
|
||||
if (*param == '"')
|
||||
{
|
||||
tmp = _tcschr(param+1,'"');
|
||||
tmp = _tcschr(param + 1, '"');
|
||||
if (tmp)
|
||||
{
|
||||
*tmp = 0;
|
||||
title = param+1;
|
||||
tmp++;
|
||||
param = tmp;
|
||||
title = param + 1;
|
||||
tmp++;
|
||||
param = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
//skip spaces
|
||||
while(_istspace(*param))
|
||||
param++;
|
||||
|
||||
#ifdef _SYNTAX_CHECK
|
||||
//get prompt
|
||||
if ( *param == 0)
|
||||
if (*param == 0)
|
||||
{
|
||||
error_req_param_missing ();
|
||||
return 1;
|
||||
@@ -130,28 +133,28 @@ INT CommandMsgbox (LPTSTR cmd, LPTSTR param)
|
||||
prompt = param;
|
||||
|
||||
hWnd=GetConsoleWindow ();
|
||||
// DebugPrintf("FindWindow hWnd = %d\n",hWnd);
|
||||
ConErrPrintf("FindWindow hWnd = %d\n",hWnd);
|
||||
// DebugPrintf("FindWindow hWnd = %d\n",hWnd);
|
||||
// ConErrPrintf("FindWindow hWnd = %d\n",hWnd);
|
||||
|
||||
switch (
|
||||
MessageBox(hWnd,prompt,title,uType)
|
||||
)
|
||||
switch (MessageBox(hWnd, prompt, title, uType))
|
||||
{
|
||||
case IDYES:
|
||||
case IDOK:
|
||||
nErrorLevel = 10;
|
||||
break;
|
||||
case IDYES:
|
||||
case IDOK:
|
||||
nErrorLevel = 10;
|
||||
break;
|
||||
|
||||
case IDNO:
|
||||
nErrorLevel = 11;
|
||||
break;
|
||||
case IDNO:
|
||||
nErrorLevel = 11;
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
nErrorLevel = 12;
|
||||
break;
|
||||
case IDCANCEL:
|
||||
nErrorLevel = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* INCLUDE_CMD_MSGBOX */
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -39,10 +39,9 @@ INT cmd_path (LPTSTR cmd, LPTSTR param)
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_PATH_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_PATH_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -56,8 +55,8 @@ INT cmd_path (LPTSTR cmd, LPTSTR param)
|
||||
dwBuffer = GetEnvironmentVariable (_T("PATH"), pszBuffer, ENV_BUFFER_SIZE);
|
||||
if (dwBuffer == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_PATH_ERROR, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_PATH_ERROR, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg);
|
||||
return 0;
|
||||
}
|
||||
else if (dwBuffer > ENV_BUFFER_SIZE)
|
||||
@@ -84,3 +83,5 @@ INT cmd_path (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -45,9 +45,8 @@ INT cmd_pause (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_PAUSE_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_PAUSE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -62,3 +61,5 @@ INT cmd_pause (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
|
||||
/*
|
||||
* print the command-line prompt
|
||||
*
|
||||
*/
|
||||
VOID PrintPrompt(VOID)
|
||||
{
|
||||
@@ -186,15 +185,15 @@ INT cmd_prompt (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_PROMPT_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
|
||||
#ifdef FEATURE_DIRECTORY_STACK
|
||||
LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_PROMPT_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
#endif
|
||||
LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_PROMPT_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -205,3 +204,5 @@ INT cmd_prompt (LPTSTR cmd, LPTSTR param)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -43,6 +43,7 @@ enum
|
||||
*/
|
||||
INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR *arg = NULL;
|
||||
INT args = 0;
|
||||
INT nEvalArgs = 0; /* nunber of evaluated arguments */
|
||||
@@ -58,15 +59,13 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA f;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp(param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_REN_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts(szMsg);
|
||||
|
||||
return(0);
|
||||
}
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_REN_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* split the argument list */
|
||||
arg = split(param, &args, FALSE);
|
||||
@@ -76,7 +75,7 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||
if (!(dwFlags & REN_ERROR))
|
||||
error_req_param_missing();
|
||||
freep(arg);
|
||||
return(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* read options */
|
||||
@@ -127,7 +126,7 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||
if (!(dwFlags & REN_ERROR))
|
||||
error_req_param_missing();
|
||||
freep(arg);
|
||||
return(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* get destination pattern */
|
||||
@@ -239,8 +238,8 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
if (!(dwFlags & REN_ERROR))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_REN_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPrintf (szMsg, GetLastError());
|
||||
LoadString(GetModuleHandle(NULL), STRING_REN_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, GetLastError());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,20 +249,17 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
|
||||
if (!(dwFlags & REN_QUIET))
|
||||
{
|
||||
if (dwFiles == 1)
|
||||
LoadString( GetModuleHandle(NULL), STRING_REN_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
else
|
||||
LoadString( GetModuleHandle(NULL), STRING_REN_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
|
||||
ConOutPrintf(szMsg,dwFiles);
|
||||
}
|
||||
{
|
||||
if (dwFiles == 1)
|
||||
LoadString( GetModuleHandle(NULL), STRING_REN_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
else
|
||||
LoadString( GetModuleHandle(NULL), STRING_REN_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf((LPTSTR)szMsg,dwFiles);
|
||||
}
|
||||
|
||||
|
||||
|
||||
freep(arg);
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,24 +4,23 @@
|
||||
#define STRING_ERROR_PARAMETERF_ERROR 100
|
||||
#define STRING_ERROR_INVALID_SWITCH 101
|
||||
#define STRING_ERROR_TOO_MANY_PARAMETERS 102
|
||||
#define STRING_ERROR_PATH_NOT_FOUND 103
|
||||
#define STRING_ERROR_FILE_NOT_FOUND 104
|
||||
#define STRING_ERROR_REQ_PARAM_MISSING 105
|
||||
#define STRING_ERROR_INVALID_DRIVE 106
|
||||
#define STRING_ERROR_PATH_NOT_FOUND 103
|
||||
#define STRING_ERROR_FILE_NOT_FOUND 104
|
||||
#define STRING_ERROR_REQ_PARAM_MISSING 105
|
||||
#define STRING_ERROR_INVALID_DRIVE 106
|
||||
#define STRING_ERROR_INVALID_PARAM_FORMAT 107
|
||||
#define STRING_ERROR_BADCOMMAND 108
|
||||
#define STRING_ERROR_OUT_OF_MEMORY 109
|
||||
#define STRING_ERROR_CANNOTPIPE 110
|
||||
#define STRING_ERROR_D_PAUSEMSG 111
|
||||
#define STRING_ERROR_BADCOMMAND 108
|
||||
#define STRING_ERROR_OUT_OF_MEMORY 109
|
||||
#define STRING_ERROR_CANNOTPIPE 110
|
||||
#define STRING_ERROR_D_PAUSEMSG 111
|
||||
#define STRING_ERROR_DRIVER_NOT_READY 112
|
||||
|
||||
#define STRING_CHOICE_OPTION 200
|
||||
#define STRING_COPY_OPTION 201
|
||||
#define STRING_DEL_OPTION 202
|
||||
|
||||
#define STRING_ALIAS_ERROR 300
|
||||
#define STRING_BATCH_ERROR 301
|
||||
#define STRING_CHCP_ERROR1 302
|
||||
#define STRING_CHCP_ERROR1 302
|
||||
#define STRING_CHCP_ERROR2 303
|
||||
#define STRING_CHCP_ERROR3 304
|
||||
#define STRING_CHCP_ERROR4 305
|
||||
@@ -43,17 +42,12 @@
|
||||
#define STRING_COPY_ERROR3 321
|
||||
#define STRING_COPY_ERROR4 322
|
||||
#define STRING_DATE_ERROR 323
|
||||
#define STRING_DEL_ERROR1 324
|
||||
#define STRING_DEL_ERROR2 325
|
||||
#define STRING_DEL_ERROR3 326
|
||||
#define STRING_DEL_ERROR4 327
|
||||
#define STRING_DEL_ERROR5 328
|
||||
#define STRING_DEL_ERROR6 329
|
||||
#define STRING_DEL_ERROR7 330
|
||||
#define STRING_DEL_ERROR8 331
|
||||
#define STRING_ERROR_ERROR1 332
|
||||
#define STRING_ERROR_ERROR2 333
|
||||
#define STRING_FOR_ERROR1 334
|
||||
#define STRING_FOR_ERROR1 334
|
||||
#define STRING_FOR_ERROR2 335
|
||||
#define STRING_FOR_ERROR3 336
|
||||
#define STRING_FOR_ERROR4 337
|
||||
@@ -61,7 +55,7 @@
|
||||
#define STRING_FREE_ERROR2 339
|
||||
#define STRING_GOTO_ERROR1 340
|
||||
#define STRING_GOTO_ERROR2 341
|
||||
#define STRING_MOVE_ERROR1 342
|
||||
#define STRING_MOVE_ERROR1 342
|
||||
#define STRING_MOVE_ERROR2 343
|
||||
#define STRING_PARAM_ERROR 344
|
||||
#define STRING_PATH_ERROR 345
|
||||
@@ -81,7 +75,7 @@
|
||||
#define STRING_CHCP_HELP 605
|
||||
#define STRING_CHOICE_HELP 606
|
||||
#define STRING_CLS_HELP 607
|
||||
#define STRING_CMD_HELP1 608
|
||||
#define STRING_CMD_HELP1 608
|
||||
#define STRING_CMD_HELP2 609
|
||||
#define STRING_CMD_HELP3 610
|
||||
#define STRING_CMD_HELP4 611
|
||||
@@ -97,12 +91,12 @@
|
||||
#define STRING_DATE_HELP3 621
|
||||
#define STRING_DATE_HELP4 622
|
||||
#define STRING_DEL_HELP1 623
|
||||
#define STRING_DEL_HELP2 624
|
||||
#define STRING_DEL_HELP2 624
|
||||
#define STRING_DEL_HELP3 625
|
||||
#define STRING_DEL_HELP4 626
|
||||
#define STRING_DELAY_HELP 627
|
||||
#define STRING_DELAY_HELP 627
|
||||
|
||||
#define STRING_DIR_HELP1 628
|
||||
#define STRING_DIR_HELP1 628
|
||||
#define STRING_DIR_HELP2 629
|
||||
#define STRING_DIR_HELP3 630
|
||||
#define STRING_DIR_HELP4 631
|
||||
@@ -119,14 +113,14 @@
|
||||
#define STRING_ECHO_HELP1 640
|
||||
#define STRING_ECHO_HELP2 641
|
||||
#define STRING_ECHO_HELP3 642
|
||||
#define STRING_ECHO_HELP4 643
|
||||
#define STRING_ECHO_HELP5 644
|
||||
#define STRING_ECHO_HELP4 643
|
||||
#define STRING_ECHO_HELP5 644
|
||||
|
||||
#define STRING_EXIT_HELP 645
|
||||
|
||||
#define STRING_FOR_HELP1 646
|
||||
|
||||
#define STRING_FREE_HELP1 647
|
||||
#define STRING_FREE_HELP1 647
|
||||
#define STRING_FREE_HELP2 648
|
||||
|
||||
#define STRING_IF_HELP1 650
|
||||
@@ -151,7 +145,7 @@
|
||||
#define STRING_MOVE_HELP1 662
|
||||
#define STRING_MOVE_HELP2 663
|
||||
|
||||
#define STRING_MSGBOX_HELP 664
|
||||
#define STRING_MSGBOX_HELP 664
|
||||
|
||||
#define STRING_PATH_HELP1 665
|
||||
|
||||
@@ -198,24 +192,18 @@
|
||||
#define STRING_VERSION_HELP4 690
|
||||
#define STRING_VERSION_HELP5 691
|
||||
#define STRING_VERSION_HELP6 692
|
||||
#define STRING_VERSION_HELP7 693
|
||||
|
||||
#define STRING_VOL_HELP1 693
|
||||
#define STRING_VOL_HELP2 694
|
||||
#define STRING_VOL_HELP3 695
|
||||
#define STRING_VOL_HELP4 696
|
||||
#define STRING_VOL_HELP1 694
|
||||
#define STRING_VOL_HELP2 695
|
||||
#define STRING_VOL_HELP3 696
|
||||
#define STRING_VOL_HELP4 697
|
||||
|
||||
#define STRING_WINDOW_HELP1 697
|
||||
#define STRING_WINDOW_HELP2 698
|
||||
#define STRING_WINDOW_HELP1 698
|
||||
#define STRING_WINDOW_HELP2 699
|
||||
|
||||
#define STRING_FreeDOS_DEV 800
|
||||
/* These strings are language independent (cmd.rc) */
|
||||
#define STRING_FREEDOS_DEV 800
|
||||
#define STRING_REACTOS_DEV 801
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -19,15 +19,14 @@
|
||||
|
||||
INT CommandScreen (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
SHORT x,y;
|
||||
BOOL bSkipText = FALSE;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (_tcsncmp (param, _T("/?"), 2) == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_SCREEN_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts((LPTSTR)szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_SCREEN_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,13 @@
|
||||
|
||||
INT cmd_set (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
LPTSTR p;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR p;
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_SET_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_SET_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,8 @@ INT cmd_shift (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_SHIFT_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString(GetModuleHandle(NULL), STRING_SHIFT_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -69,3 +68,5 @@ INT cmd_shift (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -19,17 +19,15 @@
|
||||
|
||||
INT cmd_start (LPTSTR first, LPTSTR rest)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szFullName[MAX_PATH];
|
||||
BOOL bWait = FALSE;
|
||||
TCHAR *param;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (_tcsncmp (rest, _T("/?"), 2) == 0)
|
||||
{
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_START_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts(szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_START_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -47,11 +45,13 @@ INT cmd_start (LPTSTR first, LPTSTR rest)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( !*rest )
|
||||
{
|
||||
// FIXME: use comspec instead
|
||||
rest = _T("cmd");
|
||||
}
|
||||
|
||||
/* get the PATH environment variable and parse it */
|
||||
/* search the PATH environment variable for the binary */
|
||||
param = _tcschr( rest, _T(' ') ); // skip program name to reach parameters
|
||||
@@ -60,21 +60,23 @@ INT cmd_start (LPTSTR first, LPTSTR rest)
|
||||
*param = 0;
|
||||
param++;
|
||||
}
|
||||
|
||||
if (!SearchForExecutable (rest, szFullName))
|
||||
{
|
||||
error_bad_command ();
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* check if this is a .BAT or .CMD file */
|
||||
if (!_tcsicmp (_tcsrchr (szFullName, _T('.')), _T(".bat")) ||
|
||||
!_tcsicmp (_tcsrchr (szFullName, _T('.')), _T(".cmd")))
|
||||
!_tcsicmp (_tcsrchr (szFullName, _T('.')), _T(".cmd")))
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("[BATCH: %s %s]\n"), szFullName, rest);
|
||||
#endif
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_START_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_START_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPuts(szMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -101,7 +103,7 @@ INT cmd_start (LPTSTR first, LPTSTR rest)
|
||||
stui.wShowWindow = SW_SHOWDEFAULT;
|
||||
|
||||
if (CreateProcess (szFullName, szFullCmdLine, NULL, NULL, FALSE,
|
||||
CREATE_NEW_CONSOLE, NULL, NULL, &stui, &prci))
|
||||
CREATE_NEW_CONSOLE, NULL, NULL, &stui, &prci))
|
||||
{
|
||||
if (bWait)
|
||||
{
|
||||
@@ -115,8 +117,8 @@ INT cmd_start (LPTSTR first, LPTSTR rest)
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorMessage (GetLastError (),
|
||||
_T("Error executing CreateProcess()!!\n"));
|
||||
ErrorMessage(GetLastError (),
|
||||
_T("Error executing CreateProcess()!!\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,11 +174,11 @@ static
|
||||
WORD txt_clr(LPTSTR str)
|
||||
{
|
||||
INT i;
|
||||
|
||||
for(i=0;*(clrtable[i].name);i++)
|
||||
if( _tcsnicmp(str,clrtable[i].name,_tcslen(clrtable[i].name)) == 0)
|
||||
|
||||
for(i = 0; *(clrtable[i].name); i++)
|
||||
if (_tcsnicmp(str, clrtable[i].name, _tcslen(clrtable[i].name)) == 0)
|
||||
return clrtable[i].val;
|
||||
|
||||
|
||||
return (WORD)-1;
|
||||
}
|
||||
|
||||
@@ -188,37 +188,35 @@ WORD txt_clr(LPTSTR str)
|
||||
static
|
||||
WORD str_to_color(LPTSTR* arg_str)
|
||||
{
|
||||
LPTSTR str;
|
||||
LPTSTR str;
|
||||
BOOL bBri;
|
||||
|
||||
WORD tmp_clr,ret_clr;
|
||||
|
||||
str = *arg_str;
|
||||
|
||||
|
||||
|
||||
if(!(*str))
|
||||
if (!(*str))
|
||||
return (WORD)-1;
|
||||
|
||||
|
||||
/*foreground*/
|
||||
bBri = FALSE;
|
||||
bBri = FALSE;
|
||||
|
||||
if(_tcsnicmp(str,_T("bri"),3) == 0 )
|
||||
if (_tcsnicmp(str,_T("bri"),3) == 0)
|
||||
{
|
||||
bBri = TRUE;
|
||||
|
||||
if(chop_blank(&str))
|
||||
if (chop_blank(&str))
|
||||
return (WORD)-1;
|
||||
}
|
||||
|
||||
if( (tmp_clr = txt_clr(str)) == (WORD)-1 )
|
||||
if ((tmp_clr = txt_clr(str)) == (WORD)-1)
|
||||
{
|
||||
return (WORD)-1;
|
||||
}
|
||||
|
||||
/*skip spaces and "on"*/
|
||||
if ( chop_blank(&str) || chop_blank(&str) )
|
||||
/*skip spaces and "on"*/
|
||||
if (chop_blank(&str) || chop_blank(&str))
|
||||
return (WORD)-1;
|
||||
|
||||
ret_clr = tmp_clr | (bBri << 3);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* Fixed time input bug.
|
||||
*
|
||||
* 30-Apr-2005 (Magnus Olsen) <[email protected]>)
|
||||
* Remove all hardcode string to En.rc
|
||||
* Remove all hardcode string to En.rc.
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
@@ -132,18 +132,17 @@ static BOOL ParseTime (LPTSTR s)
|
||||
|
||||
INT cmd_time (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR *arg;
|
||||
INT argc;
|
||||
INT i;
|
||||
BOOL bPrompt = TRUE;
|
||||
INT nTimeString = -1;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_TIME_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts(szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_TIME_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -175,8 +174,8 @@ INT cmd_time (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR s[40];
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_TIME_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_TIME_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
|
||||
ConInString (s, 40);
|
||||
|
||||
@@ -204,8 +203,9 @@ INT cmd_time (LPTSTR cmd, LPTSTR param)
|
||||
/* force input the next time around. */
|
||||
nTimeString = -1;
|
||||
}
|
||||
LoadString( GetModuleHandle(NULL), STRING_TIME_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_TIME_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPuts(szMsg);
|
||||
}
|
||||
|
||||
freep (arg);
|
||||
|
||||
@@ -47,8 +47,8 @@ PrintElapsedTime (DWORD time,INT format)
|
||||
switch (format)
|
||||
{
|
||||
case 0:
|
||||
LoadString( GetModuleHandle(NULL), STRING_TIMER_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf(szMsg,time);
|
||||
LoadString(GetModuleHandle(NULL), STRING_TIMER_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, time);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@@ -56,13 +56,13 @@ PrintElapsedTime (DWORD time,INT format)
|
||||
time /= 1000;
|
||||
s = time % 60;
|
||||
time /=60;
|
||||
m = time % 60;
|
||||
m = time % 60;
|
||||
h = time / 60;
|
||||
LoadString( GetModuleHandle(NULL), STRING_TIMER_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
LoadString( GetModuleHandle(NULL), STRING_TIMER_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg,
|
||||
h,cTimeSeparator,
|
||||
m,cTimeSeparator,
|
||||
s,cDecimalSeparator,ms/10);
|
||||
h, cTimeSeparator,
|
||||
m, cTimeSeparator,
|
||||
s, cDecimalSeparator, ms/10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -104,8 +104,8 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (_tcsncmp (param, _T("/?"), 2) == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_TIMER_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg,cTimeSeparator,cTimeSeparator,cDecimalSeparator);
|
||||
LoadString(GetModuleHandle(NULL), STRING_TIMER_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, cTimeSeparator, cTimeSeparator, cDecimalSeparator);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,6 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
|
||||
// other options
|
||||
if (p[i][0] == _T('/'))
|
||||
{
|
||||
|
||||
// set timer number
|
||||
if (_istdigit(p[i][1]) && bCanNSet)
|
||||
{
|
||||
@@ -149,7 +148,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
|
||||
// specify format
|
||||
if(_totupper(p[i][1]) == _T('F'))
|
||||
if (_totupper(p[i][1]) == _T('F'))
|
||||
{
|
||||
iFormat = p[i][2] - _T('0');
|
||||
continue;
|
||||
@@ -184,9 +183,10 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(NewClkStatus == NCS_NOT_SPECIFIED)
|
||||
{
|
||||
if(cS){
|
||||
if (NewClkStatus == NCS_NOT_SPECIFIED)
|
||||
{
|
||||
if (cS)
|
||||
{
|
||||
cS=FALSE;
|
||||
PS;
|
||||
PrintElapsedTime(GetTickCount()-cT, iFormat);
|
||||
@@ -202,9 +202,9 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
|
||||
|
||||
if(NewClkStatus == NCS_OFF)
|
||||
if (NewClkStatus == NCS_OFF)
|
||||
{
|
||||
if(cS)
|
||||
if (cS)
|
||||
{
|
||||
cS=FALSE;
|
||||
PS;
|
||||
|
||||
@@ -26,8 +26,8 @@ INT cmd_title (LPTSTR cmd, LPTSTR param)
|
||||
/* Asking help? */
|
||||
if (!_tcsncmp(param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_TITLE_HELP, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts(szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_TITLE_HELP, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR buff[256];
|
||||
HANDLE hFile, hConsoleOut;
|
||||
DWORD dwRead;
|
||||
@@ -42,14 +43,13 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||
INT argc,i;
|
||||
LPTSTR *argv;
|
||||
LPTSTR errmsg;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
|
||||
hConsoleOut=GetStdHandle (STD_OUTPUT_HANDLE);
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_TYPE_HELP1, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_TYPE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -65,10 +65,11 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
if (_T('/') == argv[i][0])
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_TYPE_ERROR1, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConErrPrintf (szMsg, argv[i] + 1);
|
||||
LoadString(GetModuleHandle(NULL), STRING_TYPE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPrintf(szMsg, argv[i] + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
hFile = CreateFile(argv[i],
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ,NULL,
|
||||
@@ -101,8 +102,8 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||
} while(dwRead>0 && bRet);
|
||||
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
freep (argv);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -63,29 +63,26 @@ VOID ShortVersion (VOID)
|
||||
*/
|
||||
INT cmd_ver (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
INT i;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR rosdev[RC_STRING_MAX_SIZE];
|
||||
TCHAR fredev[RC_STRING_MAX_SIZE];
|
||||
INT i;
|
||||
|
||||
if (_tcsstr (param, _T("/?")) != NULL)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERSION_HELP1, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERSION_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ShortVersion();
|
||||
ConOutPuts (_T("Copyright (C) 1994-1998 Tim Norman and others."));
|
||||
ConOutPuts (_T("Copyright (C) 1998-2001 Eric Kohl and others."));
|
||||
ConOutPuts (_T("Copyright (C) 1998-2005 Eric Kohl and others."));
|
||||
|
||||
/* Basic copyright notice */
|
||||
if (param[0] == _T('\0'))
|
||||
{
|
||||
ConOutPuts (_T("\n"SHELLINFO));
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERSION_HELP2, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConOutPuts (szMsg);
|
||||
ConOutPuts(_T("\n"SHELLINFO));
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERSION_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -109,38 +106,26 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
|
||||
if (_totupper (param[i]) == _T('W'))
|
||||
{
|
||||
/* Warranty notice */
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERSION_HELP3, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERSION_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
}
|
||||
else if (_totupper (param[i]) == _T('R'))
|
||||
{
|
||||
/* Redistribution notice */
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERSION_HELP4, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERSION_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
}
|
||||
else if (_totupper (param[i]) == _T('C'))
|
||||
{
|
||||
/* Developer listing */
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_REACTOS_DEV, rosdev,sizeof(rosdev)/sizeof(TCHAR));
|
||||
LoadString( GetModuleHandle(NULL), STRING_FreeDOS_DEV, fredev,sizeof(fredev)/sizeof(TCHAR));
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERSION_HELP6, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConOutPrintf ((LPTSTR)szMsg,fredev,rosdev);
|
||||
|
||||
/*
|
||||
ConOutPuts (_T("\n"
|
||||
"FreeDOS version written by:\n"
|
||||
" Tim Norman Matt Rains\n"
|
||||
" Evan Jeffrey Steffen Kaiser\n"
|
||||
" Svante Frey Oliver Mueller\n"
|
||||
" Aaron Kaufman Marc Desrochers\n"
|
||||
" Rob Lake John P Price\n"
|
||||
" Hans B Pufal\n"
|
||||
"\n"
|
||||
"ReactOS version written by:\n"
|
||||
" Eric Kohl Emanuele Aliberti\n"
|
||||
" Paolo Pantaleo Phillip Susi\n"));
|
||||
*/
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERSION_HELP6, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_FREEDOS_DEV, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERSION_HELP7, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_REACTOS_DEV, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -150,8 +135,8 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
|
||||
}
|
||||
}
|
||||
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERSION_HELP5, (LPTSTR) szMsg,sizeof(szMsg));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERSION_HELP5, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,23 +34,25 @@ INT cmd_verify (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERIFY_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERIFY_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!*param)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERIFY_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, bVerify ? D_ON : D_OFF);
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERIFY_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf((LPTSTR)szMsg, bVerify ? D_ON : D_OFF);
|
||||
}
|
||||
else if (_tcsicmp (param, D_OFF) == 0)
|
||||
bVerify = FALSE;
|
||||
else if (_tcsicmp (param, D_ON) == 0)
|
||||
bVerify = TRUE;
|
||||
else
|
||||
LoadString( GetModuleHandle(NULL), STRING_VERIFY_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
else
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), STRING_VERIFY_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -29,10 +29,9 @@
|
||||
static INT
|
||||
PrintVolumeHeader (LPTSTR pszRootPath)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szVolName[80];
|
||||
DWORD dwSerialNr;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
|
||||
/* get the volume information of the drive */
|
||||
if(!GetVolumeInformation (pszRootPath,
|
||||
@@ -49,44 +48,34 @@ PrintVolumeHeader (LPTSTR pszRootPath)
|
||||
}
|
||||
|
||||
/* print drive info */
|
||||
|
||||
|
||||
|
||||
|
||||
if (szVolName[0] != '\0')
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_VOL_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, pszRootPath[0],szVolName);
|
||||
LoadString(GetModuleHandle(NULL), STRING_VOL_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, pszRootPath[0],szVolName);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_VOL_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg, pszRootPath[0]);
|
||||
LoadString(GetModuleHandle(NULL), STRING_VOL_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, pszRootPath[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* print the volume serial number */
|
||||
LoadString( GetModuleHandle(NULL), STRING_VOL_HELP3, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPrintf (szMsg,
|
||||
HIWORD(dwSerialNr),
|
||||
LOWORD(dwSerialNr));
|
||||
LoadString(GetModuleHandle(NULL), STRING_VOL_HELP3, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPrintf(szMsg, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
INT cmd_vol (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR szRootPath[] = _T("A:\\");
|
||||
TCHAR szPath[MAX_PATH];
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_VOL_HELP4, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts ((LPTSTR)szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_VOL_HELP4, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -233,29 +233,29 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
||||
DebugPrintf (_T("SearchForExecutable(): Loaded PATHEXT: %s\n"), pszBuffer);
|
||||
#endif
|
||||
|
||||
pExt = _tcsrchr(pFileName, _T('.'));
|
||||
pExt = _tcsrchr(pFileName, _T('.'));
|
||||
if (pExt != NULL)
|
||||
{
|
||||
LPTSTR pszBuffer2;
|
||||
pszBuffer2 = _tcsdup(pszBuffer);
|
||||
if (pszBuffer2)
|
||||
{
|
||||
pCh = _tcstok(pszBuffer2, _T(";"));
|
||||
while (pCh)
|
||||
{
|
||||
if (0 == _tcsicmp(pCh, pExt))
|
||||
{
|
||||
LPTSTR pszBuffer2;
|
||||
pszBuffer2 = _tcsdup(pszBuffer);
|
||||
if (pszBuffer2)
|
||||
{
|
||||
pCh = _tcstok(pszBuffer2, _T(";"));
|
||||
while (pCh)
|
||||
{
|
||||
if (0 == _tcsicmp(pCh, pExt))
|
||||
{
|
||||
free(pszBuffer);
|
||||
free(pszBuffer2);
|
||||
return SearchForExecutableSingle(pFileName, pFullName, NULL);
|
||||
}
|
||||
pCh = _tcstok(NULL, _T(";"));
|
||||
}
|
||||
free(pszBuffer2);
|
||||
}
|
||||
return SearchForExecutableSingle(pFileName, pFullName, NULL);
|
||||
}
|
||||
pCh = _tcstok(NULL, _T(";"));
|
||||
}
|
||||
free(pszBuffer2);
|
||||
}
|
||||
}
|
||||
|
||||
pCh = _tcstok(pszBuffer, _T(";"));
|
||||
pCh = _tcstok(pszBuffer, _T(";"));
|
||||
while (pCh)
|
||||
{
|
||||
if (SearchForExecutableSingle(pFileName, pFullName, pCh))
|
||||
@@ -269,3 +269,5 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
||||
free(pszBuffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -37,53 +37,52 @@
|
||||
|
||||
*/
|
||||
|
||||
static
|
||||
INT ServiceActivate (LPTSTR param, HWND hWnd)
|
||||
static INT ServiceActivate (LPTSTR param, HWND hWnd)
|
||||
{
|
||||
LPTSTR *p=0,p_tmp;
|
||||
INT argc=0,i;
|
||||
INT iAction=0;
|
||||
LPTSTR title=0;
|
||||
LPTSTR *p = 0, p_tmp;
|
||||
INT argc = 0, i;
|
||||
INT iAction = 0;
|
||||
LPTSTR title = 0;
|
||||
WINDOWPLACEMENT wp;
|
||||
RECT pos;
|
||||
LPTSTR tmp;
|
||||
|
||||
|
||||
if(*param)
|
||||
p=split(param,&argc);
|
||||
if (*param)
|
||||
p = split(param, &argc);
|
||||
|
||||
|
||||
for(i = 0; i < argc; i++)
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
p_tmp=p[i];
|
||||
p_tmp = p[i];
|
||||
if (*p_tmp == _T('/'))
|
||||
p_tmp++;
|
||||
|
||||
if (_tcsicmp(p_tmp,_T("min"))==0)
|
||||
if (_tcsicmp(p_tmp, _T("min")) == 0)
|
||||
{
|
||||
iAction |= A_MIN;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_tcsicmp(p_tmp,_T("max"))==0)
|
||||
if (_tcsicmp(p_tmp, _T("max")) == 0)
|
||||
{
|
||||
iAction |= A_MAX;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_tcsicmp(p_tmp,_T("restore"))==0)
|
||||
if (_tcsicmp(p_tmp, _T("restore")) == 0)
|
||||
{
|
||||
iAction |= A_RESTORE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_tcsicmp(p_tmp,_T("close"))==0)
|
||||
if (_tcsicmp(p_tmp, _T("close")) == 0)
|
||||
{
|
||||
iAction |= A_CLOSE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_tcsnicmp(p_tmp,_T("pos"),3)==0)
|
||||
if (_tcsnicmp(p_tmp, _T("pos"), 3) == 0)
|
||||
{
|
||||
iAction |= A_POS;
|
||||
tmp = p_tmp+3;
|
||||
@@ -91,7 +90,7 @@ INT ServiceActivate (LPTSTR param, HWND hWnd)
|
||||
tmp++;
|
||||
|
||||
pos.left= _ttoi(tmp);
|
||||
if(!(tmp=_tcschr(tmp,_T(','))))
|
||||
if(!(tmp=_tcschr(tmp, _T(','))))
|
||||
{
|
||||
error_invalid_parameter_format(p[i]);
|
||||
freep(p);
|
||||
@@ -99,15 +98,15 @@ INT ServiceActivate (LPTSTR param, HWND hWnd)
|
||||
}
|
||||
|
||||
pos.top = _ttoi (++tmp);
|
||||
if(!(tmp=_tcschr(tmp,_T(','))))
|
||||
if(!(tmp=_tcschr(tmp, _T(','))))
|
||||
{
|
||||
error_invalid_parameter_format(p[i]);
|
||||
freep(p);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pos.right = _ttoi(++tmp)+pos.left;
|
||||
if(!(tmp=_tcschr(tmp,_T(','))))
|
||||
pos.right = _ttoi(++tmp) + pos.left;
|
||||
if (!(tmp = _tcschr(tmp, _T(','))))
|
||||
{
|
||||
error_invalid_parameter_format(p[i]);
|
||||
freep(p);
|
||||
@@ -117,13 +116,13 @@ INT ServiceActivate (LPTSTR param, HWND hWnd)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_tcsnicmp(p_tmp,_T("size"),4)==0)
|
||||
if (_tcsnicmp(p_tmp, _T("size"), 4)==0)
|
||||
{
|
||||
iAction |=A_SIZE;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*none of them=window title*/
|
||||
/* none of them=window title */
|
||||
if (title)
|
||||
{
|
||||
error_invalid_parameter_format(p[i]);
|
||||
@@ -133,39 +132,39 @@ INT ServiceActivate (LPTSTR param, HWND hWnd)
|
||||
|
||||
if (p_tmp[0] == _T('"'))
|
||||
{
|
||||
title = (p_tmp+1);
|
||||
*_tcschr(p_tmp+1,_T('"'))=0;
|
||||
title = (p_tmp + 1);
|
||||
*_tcschr(p_tmp + 1, _T('"')) = 0;
|
||||
continue;
|
||||
}
|
||||
title = p_tmp;
|
||||
}
|
||||
|
||||
if(title)
|
||||
SetWindowText(hWnd,title);
|
||||
if (title)
|
||||
SetWindowText(hWnd, title);
|
||||
|
||||
wp.length=sizeof(WINDOWPLACEMENT);
|
||||
GetWindowPlacement(hWnd,&wp);
|
||||
wp.length = sizeof(WINDOWPLACEMENT);
|
||||
GetWindowPlacement(hWnd, &wp);
|
||||
|
||||
if(iAction & A_POS)
|
||||
wp.rcNormalPosition = pos;
|
||||
if (iAction & A_POS)
|
||||
wp.rcNormalPosition = pos;
|
||||
|
||||
if(iAction & A_MIN)
|
||||
wp.showCmd=SW_MINIMIZE;
|
||||
if (iAction & A_MIN)
|
||||
wp.showCmd = SW_MINIMIZE;
|
||||
|
||||
if(iAction & A_MAX)
|
||||
wp.showCmd=SW_SHOWMAXIMIZED;
|
||||
if (iAction & A_MAX)
|
||||
wp.showCmd = SW_SHOWMAXIMIZED;
|
||||
|
||||
/*if no actions are specified default is SW_RESTORE*/
|
||||
if( (iAction & A_RESTORE) || (!iAction) )
|
||||
wp.showCmd=SW_RESTORE;
|
||||
if ((iAction & A_RESTORE) || (!iAction))
|
||||
wp.showCmd = SW_RESTORE;
|
||||
|
||||
if(iAction & A_CLOSE)
|
||||
if (iAction & A_CLOSE)
|
||||
ConErrPrintf(_T("!!!FIXME: CLOSE Not implemented!!!\n"));
|
||||
|
||||
wp.length=sizeof(WINDOWPLACEMENT);
|
||||
SetWindowPlacement(hWnd,&wp);
|
||||
wp.length = sizeof(WINDOWPLACEMENT);
|
||||
SetWindowPlacement(hWnd, &wp);
|
||||
|
||||
if(p)
|
||||
if (p)
|
||||
freep(p);
|
||||
|
||||
return 0;
|
||||
@@ -176,33 +175,32 @@ INT ServiceActivate (LPTSTR param, HWND hWnd)
|
||||
|
||||
INT CommandWindow (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
HWND h;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
HWND hwnd;
|
||||
|
||||
if (_tcsncmp (param, _T("/?"), 2) == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_WINDOW_HELP1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
|
||||
LoadString(GetModuleHandle(NULL), STRING_WINDOW_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
h = GetConsoleWindow();
|
||||
Sleep(0);
|
||||
return ServiceActivate(param,h);
|
||||
return ServiceActivate(param, hwnd);
|
||||
}
|
||||
|
||||
|
||||
INT CommandActivate (LPTSTR cmd, LPTSTR param)
|
||||
{
|
||||
LPTSTR str;
|
||||
HWND h;
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
LPTSTR str;
|
||||
HWND hwnd;
|
||||
|
||||
if (_tcsncmp (param, _T("/?"), 2) == 0)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_WINDOW_HELP2, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConOutPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_WINDOW_HELP2, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConOutPuts(szMsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -219,15 +217,15 @@ INT CommandActivate (LPTSTR cmd, LPTSTR param)
|
||||
else
|
||||
str = "";
|
||||
|
||||
h=FindWindow(NULL, param);
|
||||
if (!h)
|
||||
hwnd = FindWindow(NULL, param);
|
||||
if (hwnd == NULL)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), STRING_WINDOW_ERROR1, szMsg,sizeof(szMsg)/sizeof(TCHAR));
|
||||
ConErrPuts (szMsg);
|
||||
LoadString(GetModuleHandle(NULL), STRING_WINDOW_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||
ConErrPuts(szMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return ServiceActivate(str,h);
|
||||
return ServiceActivate(str, hwnd);
|
||||
}
|
||||
|
||||
#endif /* ( defined(INCLUDE_CMD_WINDOW) || defined(INCLUDE_CMD_ACTIVATE) ) */
|
||||
|
||||
Reference in New Issue
Block a user