Depends on exactly what you want to happen. More info here:
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
--
All the Best,
Kelly (MS-MVP)
Troubleshooting Windows XP
http://www.kellys-korner-xp.com