lundi 25 avril 2016

Vbscript execute a function rarely, with chances using random

New to Vbscript. I made a random function with two parameters.And called it It resulted in a infinite loop opening infinite program.

Function random(v1,v2)
 Randomize
 rdm =(Int((v2 - v1 + 1)* Rnd + v1))
End Function 

Function download()
 Set shell = createobject("wscript.shell"):shell.run "mspaint.exe"   
End function

'I want this download function to run rarely
Do
  Call random(100,1000)
  If  rdm>700 And rdm <760 Then 
  Call download()
  End If
loop




Aucun commentaire:

Enregistrer un commentaire