Seeding Randomization on CMD (WinXP Pro)

From: PsyB (psychopathNO_at_MEATshaw.ca)
Date: 10/06/04


Date: Tue, 05 Oct 2004 23:31:24 -0600

Can anyone tell me how to get a *PROPER* random number? I have defined a
variable as follows:

set randnumber=%random%

When querying the contents of my variable %randnumber% when staying
inside the CMD prompt without an exit, the variable, of course, is
randomized. However since my script takes exactly the same amount of
time to run each time it is run, the random number will always be the
same since the %random% variable is never seeded properly (indeed it
follows the same progression of "random" numbers each and every time
that CMD is started). I have tried various way to cause inconsistency in
how fast the script is executed including netstat, ping and dir -
anything that might change the execution time so that the number pulled
from the pool is different, though no matter what I have tried I end up
centering around a single number. Is there any way to generate a real
random number on CMD? Or is there any way to seed the CMD line with the
time or some other variable that would allow a better randomization? Use
of pause is out of the question, though, as this needs to be a
transparent script.

-- 
-=[PsyB]=-
Greater in battle than the man who would conquer a thousand-thousand men 
is he who would conquer just one - *himself*.
                                                --Dhammapada--


Relevant Pages

  • Re: How can I kill a stuck cmd.exe remotely?
    ... sample script code... ... Microsoft MVP - Windows Server Management Infrastructure ... > the cmd would stuck for some reasons I did not know. ... > something in order to run the WMI thing? ...
    (microsoft.public.windowsxp.wmi)
  • Re: Seeding Randomization on CMD (WinXP Pro)
    ... However since my script takes exactly the ... > change the execution time so that the number pulled from the pool ... > real random number on CMD? ... Returns an exit code of a pseudo-random number based on ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: CD to acc
    ... I m learning python, so thought i should write small py script to ... os.system (cmd) ... Run this script, while you are in the mounted CD ROM dir... ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: Scripts in Vista
    ... that can be tricky using cmd /c etc. ... and put that sort of line in the bat file. ... Monitor your enterprise Web Servers. ... I have tried to no avail to convert this to a script. ...
    (microsoft.public.windows.server.scripting)
  • Re: "Baileys comets" intro on YouTube
    ... final episode that was never made. ... a fan script or a legitimate script that was written after the series was ... it's a shame PoDW wasn't finished since it actually seemed to be ... One show that will be getting a proper conclusion will be ...
    (rec.arts.animation)