I have such a code:
Code:
;The scheduled time, it also can be replaced with a random time
$AuditTime="14:30:00"
;The time user logon on PC
$CurrentTime=@Time
;Getting the detail number to determine how many seconds script will sleep
$Hours=Cint(SubStr($AuditTime,1,2))-Cint(SubStr($CurrentTime,1,2))
$Minutes=Cint(SubStr($AuditTime,4,2))-Cint(SubStr($CurrentTime,4,2))
$Seconds=Cint(SubStr($AuditTime,7,2))-Cint(SubStr($CurrentTime,7,2))
;Work out how many seconds
$SleepTime=$Hours*3600+$Minutes*60+$Seconds
;Run a program
Run "Notepad.exe"
I set it as logon script, and as Mart said, I use wkix32.exe, I don't know why the command line displays still and waits for the time coming. But if I just run the script, the command line didnot be shown and wkix32 stayed at background. Why? How can I set it to logon script? Is there something I forgot to do?
Thanks in advance!