Discussion: %random%
Afficher un message
Vieux 10/10/2007, 18h07   #4
bvb47 via WinServerKB.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: %random%

the solution is written by BSOD in nabble forum:
----------------
BSOD wrote:
Cos in a batch %108 is interpreted as a command line parameter passed to the .
bat, the same as %0 and %1 etc etc.

use this :

SET /A X=%RANDOM%%%108%
---------------

thanks to all!.

bvb47 wrote:
>Hello!,
>
>I'm trying to obtain a random number in batch file.
>
>if I type
>> set /a X=%random%%108

>in command prompt work ok, but if I put this instruction in batch file, don't
>work!
>
>anybody know why?
>
>thanks!


--
Message posted via http://www.winserverkb.com

  Réponse avec citation
 
Page generated in 0,05390 seconds with 9 queries