Powershell: Start running a program/script with a random timer

Dear all,

I am trying to make a powershell script to active a vbs script in random time.

As this powershell script run in schedule task in server, it will activate a vbs script after seconds(in random)

The following is part of the script:-

$RANDOM_NUMBER = Get-Random -Minimum 1 -Maximum 360000
$CSCRIPT="C:\WINDOWS\SYSTEM32\Cscript.exe //onlogo //B"
$VBS_Script="c:\temp\DB_collect.vbs"

But I cannot figure out how to trigger the vbs script after random second.

Could anyone help me on this?

Thanks and Regards,

Edward

July 1st, 2013 11:52am

sleep (Get-Random -Minimum 1 -Maximum 360000)

# run vbs script

Free Windows Admin Tool Kit Click here and download it now
July 1st, 2013 12:04pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics