This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dim objShell, lngMinutes, boolValid | |
| Set objShell = CreateObject("WScript.Shell") | |
| lngMinutes = InputBox("Hello! How long you want to keep your system awake?" & Replace(Space(5), " ", vbNewLine) & "Enter minutes:", "Awake Duration") 'we are replacing 5 spaces with new lines | |
| If lngMinutes = vbEmpty Then 'If the user opts to cancel the process | |
| 'Do nothing | |
| Else | |
| On Error Resume Next | |
| Err.Clear | |
| boolValid = False | |
| lngMinutes = CLng(lngMinutes) |