Hello
I need to create a simple script that will run "shutdown -f -l -t00"
I want to schedule this script so that pcs will logoff at a specific time.
I know I can do this via a batch file but I would rather do this in a
script if possible.
Thanks in advance!

Re: vbs to logoff by McKirahan

McKirahan
Wed Nov 30 17:13:23 CST 2005

"cdoc" <cdoc@bellsouth.net> wrote in message
news:Gcqjf.26016$i7.7580@bignews2.bellsouth.net...
> Hello
> I need to create a simple script that will run "shutdown -f -l -t00"
> I want to schedule this script so that pcs will logoff at a specific time.
> I know I can do this via a batch file but I would rather do this in a
> script if possible.
> Thanks in advance!

Look at schtasks.exe under Windows XP.



Re: vbs to logoff by cdoc

cdoc
Wed Nov 30 19:15:35 CST 2005

I guess what I really need is a script that will automate the setup for
the scheduled task. I need to set this up on multiple machines and if I
had a script it would make the setup time shorter.
If I had a sample script I will be able to customize it for my needs.
Thanks

Re: vbs to logoff by McKirahan

McKirahan
Wed Nov 30 19:53:16 CST 2005

"cdoc" <compudoc@msoms.com> wrote in message
news:X8sjf.35489$s92.12277@bignews6.bellsouth.net...
> I guess what I really need is a script that will automate the setup for
> the scheduled task. I need to set this up on multiple machines and if I
> had a script it would make the setup time shorter.
> If I had a sample script I will be able to customize it for my needs.
> Thanks

schtasks is scriptable:

SCHTASKS /parameter [arguments]

Description:
Enables an administrator to create, delete, query, change, run and
end scheduled tasks on a local or remote system. Replaces AT.exe.

Parameter List:
/Create Creates a new scheduled task.
/Delete Deletes the scheduled task(s).
/Query Displays all scheduled tasks.
/Change Changes the properties of scheduled task.
/Run Runs the scheduled task immediately.
/End Stops the currently running scheduled task.
/? Displays this help/usage.



Re: vbs to logoff by Groups

Groups
Wed Nov 30 20:20:41 CST 2005

Does this help? It will force a logoff of a remote computer. It can
easily be modified for multiple computers.

*** Watch for word wrap***
strComputer = "SomeComputer"
Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" &
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(0)
Next

Michael Reese
http://www.sproik.com/tools.htm