Re: Scheduled Task for anyone who logs on



Modify it.

Added info:

Automatically log off a user or shut down your machine: You can incorporate
Rundll32 into your Windows Script Host (WSH) or command-shell scripts to log
off the current user or shut down and restart the computer. The value in the
command's last parameter controls the action that will occur: 0 performs a
logoff, 1 performs a shutdown, 2 performs a reboot, 4 performs a forced
shutdown, and 8 powers down the machine. The following example performs a
logoff:

rundll32.exe shell32.dll,
SHExitWindowsEx 0

~~~

Added suggestions and trial points:

C:\WINDOWS\system32\shutdown.exe -s -t 60 -c "Message goes here"
and the computer shuts down in 60 seconds with the message indicated.

You can use a Group Policy Computer (GPO) Configuration Logon
and/or Logoff script (The GPO can be activated manually with gpedit.msc or
through AD).

>From the Start menu Run dialog, open: gpedit.msc

Then, under "User Configuration",
open Windows Settings\Scripts (Logon/Logoff)
(double click, Add...).

More info in Tip 2147 in the 'NT Reg Hacks' at http://www.jsiinc.com

JSI Tip 2147. Windows 2000 Startup/Shutdown, Logon/Logoff scripts?
http://www.jsiinc.com/sube/tip2100/rh2147.htm

This handy program allows you to quickly and easily log off current user,
shutdown, power off and restart your computer. You could also schedule when
your computer should turn off. For the benefit of network administrators,
there is remote shutdown feature, which allows them to turn off any
computer.
http://eugenekonovalov.vlink.ru/EasyShutdown/EasyShutdown.exe

~~~

You can schedule a task to lock the desktop after a period of
inactivity.

Start/All Programs/Accessories/System Tools/Scheduled Tasks. On the last
screen, check off Show Advanced Options. Under Advanced/Settings/Idle Time
(Only start... and Stop the task...).

You can schedule a task for inactivity. Use this to lock the
desktop after 10 minutes of idle time.

Use this shortcut for the task:

%windir%\System32\rundll32.exe user32.dll,LockWorkStation

C:\Windows\System32\rundll32.exe user32.dll,LockWorkStation.

To log off and run the risk of having your programs end prematurely and
without saving any unsaved material, you could use the same scheduled task
command and replace the LockWorkStation with ExitWindows. That will log off
the currently logged on user.

To schedule a logoff procedure for XP, use this:
C:\Windows\System32\shutdown -l as the scheduled task.

A scheduled task can be run without passwords:

For Pro: Start/Control Panel/Administrative Tools/Local Security
Policy/Local Policies/Security options. In the right hand pane (third down).

Accounts: Limit local account use of blank passwords to console logon only.
This is enabled by default, disable it.

For Home: Run Scheduled Task without a Password (Line 68)
http://www.kellys-korner-xp.com/xp_tweaks.htm

Easy Log Off, Shutdown and Restart (Line 89)
http://www.kellys-korner-xp.com/xp_tweaks.htm


--
In memory of our dear friend, MVP Alex Nichol: http://www.dts-l.org/

All the Best,
Kelly (MS-MVP)

Troubleshooting Windows XP
http://www.kellys-korner-xp.com


"jped" <jped@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D41E2235-7ECD-42B5-BF12-66022B1FDDC9@xxxxxxxxxxxxxxxx
> Hi,
> I have a schedules task on a shared machine that logs the user off at a
> certain time. The task works fine, but it only works if I am logged on
> since
> I created it. Is there a way to setup the scheduled task to fun for
> anyone
> that is logged on?
>
> Thanks!


.



Relevant Pages

  • Re: Run Schedules Tasks as SYSTEM
    ... I included a subroutine in the script to ... install the script as a Scheduled task. ... ' If Windows 2003, add the duration flag (NOT supported in XP. ... the scheduled task may not run because of the security ...
    (microsoft.public.windowsxp.general)
  • Re: %windir%...scriptsshutdown Q
    ... MS-MVP Windows Shell/User ... Overview of Logon, Logoff, Startup, and Shutdown Scripts in Windows ... How To Assign a Logon Script to a Profile for a Local User in Windows ... When you use Group Policy to add a startup script... ...
    (microsoft.public.windowsxp.general)
  • Re: Auto Logoff or forced sync of My Documents
    ... Here's a copy of the VB script I run as a scheduled task on my server, ... ErrorMessage "No shutdown method has been specified in the command line." ...
    (microsoft.public.windows.server.sbs)
  • Re: Closing down Windows with a script
    ... For suggestions as to possible fixes for the underlying problem, ... but shutdown issues for all versions of Windows ... > write even a simple script to do this. ...
    (microsoft.public.scripting.wsh)
  • Re: Shutdown Scripts
    ... Instead of using a shutdown script. ... The Windows 2000 Pro PC just shuts down. ... > As per other instructions, you would be better off scheduling the defrag> script which, at the end, initiates shutdown. ...
    (microsoft.public.windows.server.active_directory)

Loading