Go to to website automatically shut down to read how to add a task
go to website :switch-user-shortcut-create.html to download tsdiscon.exe file
extract tsdiscon.exe to a dir such as C:Users\user\mydocument
go to dir C:Users\user\mydocument
record a media file as reminder SwitchUserReminder.wma by using recorder of computer in the dir C:Users\user\mydocument
create a bat file SwitchUserTask.bat, which contains (see How to create a bat file in win7)
start SwitchUserReminder.wma ( see how to play a music in bat file )
pause
tsdiscon.exe
create an task SwitchUser task according to 1, execute one time
Rem CloseCourseTask
@echo on
set dir=C:\Users\User\Documents\
set taskName=swithUserAfterPeriodOfTime
set taskCode=%dir%CourseClose_sch.bat
set preSchTask="Blank"
set elapseTime=50
call C:\Users\User\Documents\SchTaskOnTimeElapse_super.bat %taskName% %taskCode% %preSchTask% %elapseTime%
exit
Rem SwitchUserAfterPerodOfTimeTask
@echo on
set dir=C:\Users\User\Documents\
set taskName=swithUserAfterPeriodOfTime
set taskCode=%dir%SwitchUserReminder_sch.bat
set preSchTask="Blank"
set elapseTime=60
call C:\Users\User\Documents\SchTaskOnTimeElapse_super.bat %taskName% %taskCode% %preSchTask% %elapseTime%
exit
Rem SchTaskOnTimeElapse_super
@echo on
Rem delete potential cached variables
set taskName=""
set taskCode=""
Rem set taskName and task
set taskName=%1
set taskCode=%2
set preSchTask=%3
set this_duringTime=%4
Rem delete last task
if exist %taskName% schtasks /delete /tn %taskName% /f
Rem play music reminder
set music=%preSchTask%
if %music% EQU " " goto skipMusic
set lastThreeChar= %preSchTask:~-3,-1%
if %lastThreeChar% EQU wm goto music_Play
goto webMusic
:Music_play
echo %music%
if %preSchTask% NEQ "Blank" start %music%
:skipMusic
Rem get schudled time to execute task
set this_Time=%time%
set this_Hour=%this_Time:~0,2%
set this_Minute=%this_Time:~3,2%
set this_Second=%this_Time:~6,2%
set /a this_Minute=%this_Minute%+%this_duringTime%
if %this_Minute% GTR 59 goto HourMinuteChange
:schTimeSet
echo %this_Hour%
echo %this_Minute%
if %this_Hour% LSS 10 goto stdHour
set this_sHour="%this_Hour%"
:Hour_continue
if %this_Minute% LSS 10 goto stdMinute
set this_sMinute="%this_Minute%"
:Minute_continue
set this_schTime=%this_sHour%:%this_sMinute%
echo %this_schTime%
Rem create a task
if exist %taskCode% schtasks /create /sc once /tn %taskName% /tr %taskCode% /st %this_schTime%
goto lblEnd
Rem exit
:HourMinuteChange
set /a this_Minute-=60
set /a this_Hour+=1
goto schTimeSet
:stdHour
set /a this_Hour+=0
set this_sHour="0%this_Hour%"
goto Hour_continue
:stdMinute
set /a this_Minute+=0
set this_sMinute="0%this_Minute%"
goto Minute_continue
:webMusic
set music=%preSchTask:~0,-1%
set music=%music:~1%
goto Music_play
:lblEnd