Below is a simplified version. Only one rendition can be running at
a time. A somewhat more comprehensive version, with multiple calls
allowed, is included in the
@echo off & setlocal enableextensions
::
echo First customize the two instances of C:\_M\TEMP\wakeup.vbs
echo And remove the first two echo lines and the first goto :EOF
goto :EOF
::
:: Usage
if [%1]==[] (
echo.
echo Usage: %~f0 [HH:MM]
echo No error checking
goto :EOF)
::
:: Build a Visual Basic Script
set skip=
set vbs_=C:\_M\TEMP\wakeup.vbs
findstr "'%skip%VBS" "%~f0" > "%vbs_%"
::
:: Run the Visual Basic Script
at %1 /interactive "%vbs_%"
at
endlocal & goto :EOF
'
'.............................................
'The Visual Basic Script
'
Dim WshShell, fso 'VBS
Set WshShell = WScript.CreateObject("WScript.Shell") 'VBS
Set fso = CreateObject("Scripting.FileSystemObject") 'VBS
WshShell.Run "sndrec32 /play /close C:\WINDOWS\Media\tada.wav", 2, false 'VBS
WScript.Echo "Time to wake up" 'VBS
fso.DeleteFile("C:\_M\TEMP\wakeup.vbs") 'VBS
An example of the immediate output. For more on the "at" usage apply
AT /?