CMD Set Enviornment Variables Help

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
someguy
Posts: 7
Last visit: Sun Jan 10, 2010 1:18 am

CMD Set Enviornment Variables Help

Post by someguy »

Im making a command script-type thing (is going very well can type google and it goes google xD) but how to say "if variable "a" is not equal to *somemocode* then do *this*) so "if %variable%*u tell me the'not=to sign here'*password shutdown -s -t 10 -c "HA!""
User avatar
someguy
Posts: 7
Last visit: Sun Jan 10, 2010 1:18 am

CMD Set Enviornment Variables Help

Post by someguy »

Im making a command script-type thing (is going very well can type google and it goes google xD) but how to say "if variable "a" is not equal to *somemocode* then do *this*) so "if %variable%*u tell me the'not=to sign here'*password shutdown -s -t 10 -c "HA!""
User avatar
someguy
Posts: 7
Last visit: Sun Jan 10, 2010 1:18 am

CMD Set Enviornment Variables Help

Post by someguy »

in other words how do i tell the Command Prompt that if a variable is not equal to another variable then shutdown
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

CMD Set Enviornment Variables Help

Post by jhicks »

Is this the sort of thing you are after?set var=fooif %var%==foo (echo Shutting down) else (echo Staying up)
User avatar
someguy
Posts: 7
Last visit: Sun Jan 10, 2010 1:18 am

CMD Set Enviornment Variables Help

Post by someguy »

Thanks!someguy2010-01-06 15:00:14
User avatar
someguy
Posts: 7
Last visit: Sun Jan 10, 2010 1:18 am

CMD Set Enviornment Variables Help

Post by someguy »

also how to hide keys? (as in a password field)
This topic is 14 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked