|
Answer» Is there a way to use numerical variables in DOS? Integers would be fine. I want to create a count variable that I can add to.Code: [Select]C:\Users\DeltaSlaya>set/? Displays, sets, or removes cmd.exe environment variables.
SET [variable=[string]]
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:
SET P
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 not allow an equal sign to be part of the name of a variable.
Two new switches have been added to the SET command:
SET /A expression SET /P variable=[promptString]
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 ! ~ - - unary operators * / % - arithmetic operators + - - arithmetic operators << >> - logical shift & - bitwise and ^ - bitwise exclusive or | - bitwise or = *= /= %= += -= - assignment &= ^= |= <<= >>= , - expression separator Basically,
set /a variable=number or equationah, you make it LOOK so easy I guess I should have tried to read the help for the command instead of just assuming I knew it all
thank youQuote from: qz33 on August 02, 2007, 10:14:07 PM I guess I should have tried to read the help for the command instead of just assuming I knew it all
Having answered many questions on here, I can only SAY amen brother !!!!!!!
|