A couple of questions if I may.
Firstly, I can't for the life of me work out why the SET /P command is not working on my installations of NT4. Googling the command and O/S shows people able to use the /P string to read in and use the input from the user as a variable.
Set /? on my NT machine returns:
Displays, sets, or removes cmd.exe environment variables.
variable Specifies the environment-variable name.
string Specifies a series of characters to assign to the variable.
Type SET without parameters to display the current environment variables.
If Command Extensions are enabled SET changes as follows:
SET command invoked with just a variable name, no equal sign or value
will display the value of all variables whose prefix matches the name
given to the SET command. For example:
would display all variables that begin with the letter 'P'
SET command will set the ERRORLEVEL to 1 if the variable name is not
found in the current environment.
SET command will allow an equal sign (=) in the value of an environment
variable in any position other than the first character.
A new switch is added to the SET command:
SET /A expression
The /A switch specifies that the string to the right of the equal sign
is a numerical expression that is evaluated. The expression evaluator
is pretty simple and supports the following operations, in decreasing
order of precedence:
() - grouping
* / % - arithmetic operators
+ - - arithmetic operators
<< >> - logical shift
& - bitwise and
^ - bitwise exclusive or
| - bitwise or
= *= /= %= += -= - assignment
&= ^= |= <<= >>=
, - expression separator
If you use any of the logical or modulus operators, you will need to
enclose the expression string in quotes. Any non-numeric strings in the
expression are treated as environment variable names whose values are
converted to numbers before using them. If an environment variable name
is specified but is not defined in the current environment, then a value
of zero is used. This allows you to do arithmetic with environment
variable values without having to type all those % signs to get their
values. If SET /A is executed from the command line outside of a
command script, then it displays the final value of the expression. The
assignment operator requires an environment variable name to the left of
the assignment operator. Numeric values are decimal numbers, unless
prefixed by 0x for hexidecimal numbers, 0b for binary numbers and 0 for
octals numbers. So 0x12 is the same as 0b10010 is the same as 022.
Please note that the octal notation can be confusing: 08 and 09 are
not valid numbers because 8 and 9 are not valid octal digits.
Environment variable substitution has been enhanced as follows:
would expand the PATH environment variable, substituting each occurrence
of "str1" in the expanded result with "str2". "str2" can be the empty
string to effectively delete all occurrences of "str1" from the expanded
output. "str1" can begin with an asterisk, in which case it will match
everything from the begining of the expanded output to the first
occurrence of the remaining portion of str1.
would expand the PATH environment variable, and then use only the 5
characters that begin at the 11th (offset 10) character of the expanded
Which doesn't mention the /P switch at all.
My other problem is I found a free application to convert my batch file from a .BAT to a .EXE and it works in Windows XP, but the converted .EXE will not work in NT4. Does anyone else know of a good product that converts .BAT to .EXE for free?
Thanks in advance