asked on
@ECHO OFF
choice /m "Have you backup today?"
IF ERRORLEVEL 2 GOTO two
IF ERRORLEVEL 1 GOTO one
:one
echo shutdown continues as normal
GOTO END
:two
shutdown -c
echo shutdown canceled
GOTO END
:END
pause
VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.
TRUSTED BY
function lastChance()
{
return "Did you remember to make your local backup?";
}
window.onbeforeunload = lastChance;
VBScript would look similar, I suppose (not tested):
Function lastChance()
lastChance = "Did you remember to make your local backup?"
End Function
window.onbeforeunload = lastChance
Either example would go in a <script></script> block in the HEAD section of your page.