If your scripts have any error handling at all, you probably "hard coded" some error messages in your scripts.
Though there is nothing wrong with that, it might be a nice challenge to display error messages in the local system language.
You don't need to learn new languages to do so, nor will your scripts need to contain megabytes of error messages in several languages.
In Windows (and OS/2) there is a simple solution:
NET HELPMSG (or
NET HELP in OS/2).
The following (Windows NT 4+) batch file will generate a tab delimited list of all available help and error messages in your local system language:
@ECHO OFF TYPE NUL > AllHelpMsg.txt FOR /L %%A in (0,1,14999) DO FOR /F "tokens=*" %%B IN ('NET HelpMsg %%A 2ˆ>NUL') DO ( TITLE Message # %%A >> AllHelpMsg.txt ECHO.%%A %%B )
To insert an error message in your batch file, just find a matching message text in the list (AllHelpMsg.txt), write down the number, and insert the following command in your batch file:
NET HELPMSG nnnn
nnnn is the error message number you just wrote down.
|page last uploaded: 1 May 2013, 12:20|