Tuesday

.bat random number generator

here is example how to use random in bat files in simple 'guess number' game.
to call it : game.bat [total numbers to pick from] [your number]
for example : game.bat 6 3
 
set /a NUM = ( %1 * %random% ) / 32768 + 1
IF "%NUM%" EQU "%2" (echo "winner!") else (echo "loose %NUM%")


No comments:

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...