#103872 - 2003-08-17 07:00 PM
Using a Scheduled Task to run KIX
|
johnt
Fresh Scripter
Registered: 2002-03-01
Posts: 6
|
I'm trying to setup a scheduled task to call a script to log off users at a certain time. Does anyone know how to use a scheduled task to run a kix script?
I was successful using PSSHUTDOWN through task scheduler, however this tool shutdown the computer if the user was logged out.
|
|
Top
|
|
|
|
#103873 - 2003-08-17 07:15 PM
Re: Using a Scheduled Task to run KIX
|
Richie19Rich77
Seasoned Scripter
   
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
Use Logoff command, 1 will force the user to quit all applications.
code:
LogOff(1)
|
|
Top
|
|
|
|
#103876 - 2003-08-18 04:37 PM
Re: Using a Scheduled Task to run KIX
|
johnt
Fresh Scripter
Registered: 2002-03-01
Posts: 6
|
I'm using this to schedule the task.
code:
shell '%COMSPEC% /c at 04:00 /interactive /every:M,T,W,Th,F,S ""%WINDIR%\wkix32.exe"" ""winexit.kix""
This works great on an XP worksatation, but the 2000 workstation fails.
I'm using SMS to copy the files to the workstations, so it can run with admin rights.
|
|
Top
|
|
|
|
#103878 - 2003-08-18 04:56 PM
Re: Using a Scheduled Task to run KIX
|
johnt
Fresh Scripter
Registered: 2002-03-01
Posts: 6
|
So the System account won't do what I need here? BTW thanks for the quick reply's.
|
|
Top
|
|
|
|
#103879 - 2003-08-19 01:07 PM
Re: Using a Scheduled Task to run KIX
|
johnt
Fresh Scripter
Registered: 2002-03-01
Posts: 6
|
I found the problem I was having. Because the task is using the system account it was hanging on part of the script that was seeing if a network drive existed. code:
$Selection = MessageBox("This PC Needs to be logged out. Please save your work and log off. Would you like to log off now?","Time to Logoff",36, 15) If $Selection = 6 LogOff(0) Endif If $Selection = -1 LogOff(0) Endif
Does anyone know how I can prevent this from running if no one's logged in to the PC without looking at the network?
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1607 anonymous users online.
|
|
|