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.
Locked
User avatar
someguy
Posts: 7
Joined: Tue Jan 05, 2010 12:52 pm

CMD Set Enviornment Variables Help

Post by someguy » Tue Jan 05, 2010 12:57 pm

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
Joined: Tue Jan 05, 2010 12:52 pm

CMD Set Enviornment Variables Help

Post by someguy » Tue Jan 05, 2010 12:57 pm

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
Joined: Tue Jan 05, 2010 12:52 pm

CMD Set Enviornment Variables Help

Post by someguy » Tue Jan 05, 2010 12:58 pm

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
Joined: Sun Jan 21, 2007 11:31 pm

CMD Set Enviornment Variables Help

Post by jhicks » Wed Jan 06, 2010 6:56 am

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
Joined: Tue Jan 05, 2010 12:52 pm

CMD Set Enviornment Variables Help

Post by someguy » Wed Jan 06, 2010 7:50 am

Thanks!someguy2010-01-06 15:00:14

User avatar
someguy
Posts: 7
Joined: Tue Jan 05, 2010 12:52 pm

CMD Set Enviornment Variables Help

Post by someguy » Wed Jan 06, 2010 8:13 am

also how to hide keys? (as in a password field)

Locked