Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
echo offclsEcho Text//The random number goes here.If '40' Goto '40'If '41' Goto '41'//Here would the random number from 40-90 go.:40echo TextGOTO start:41echo TextGOTO start:startset /p var=
@echo offsetlocalset intLowNumber=40set intHighNumber=90set /a rnd=%random% %% (%intHighNumber% - %intLowNumber% + 1) + %intLowNumber%echo Random number between %intLowNumber% and %intHighNumber% is %rnd%
@echo offclssetlocalset intLowNumber=40set intHighNumber=90set /a rnd=%random% %% (%intHighNumber% - %intLowNumber% + 1) + %intLowNumber%%rnd% ((<=If that number is 40 then)) GOTO 40%rnd% ((<=If that number is 41 then)) GOTO 41
have you created the labels :40 and :41 for it to jump to ?
%rnd% ((<=If that number is 40 then)) GOTO 40%rnd% ((<=If that number is 41 then)) GOTO 41
I'm still learning how to use all batch commands, I just know the basics of it, but I would be grateful if anyone have the knowledge how can help me.
import randomrandom_number=random.randrange(100)if random_number < 40: print "do something"elif random_number<90: print "do something"
Code: [Select]%rnd% ((<=If that number is 40 then)) GOTO 40%rnd% ((<=If that number is 41 then)) GOTO 41Is this really part of your "code", Frejoh466? If so, I believe I know why your script keeps crashing.
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto unlockif NOT EXIST Hide goto create:lockren Hide "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"goto End:unlockecho Enter password to Unlock folderset /p "pass=>"if NOT %pass%==lol goto exitattrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Hidegoto exit:createmd Hidegoto exit:exitexit
if NOT "%pass%"=="lol" goto exit
note quote marksCode: [Select]if NOT "%pass%"=="lol" goto exit
But it work without the quotes.
goto End
Frejoh466, you changed scripts! First it was all that "goto 40" stuff, then all of a sudden you're trying to hide Control Panel! What's going on?
@echo offset intLowNumber=40set intHighNumber=50set /a rnd=%random% %% (%intHighNumber% - %intLowNumber% + 1) + %intLowNumber%goto %rnd%:40echo number=40goto end:41echo number=41goto end:42echo number=42goto end:43echo number=43goto end:44echo number=44goto end:45echo number=45goto end:46echo number=46goto end:47echo number=47goto end:48echo number=48goto end:49echo number=49goto end:50echo number=50:end