Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim objFSO, objShell, objTextFile
- Const strDirectory = "C:"
- Const strFile = "\timelog.txt"
- Const checkTimeLeftVbs = "C:\checktimeleft.vbs"
- Const ForAppending = 8
- Const ForReading = 1
- Const ForWriting = 2
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objShell = WScript.CreateObject ("WScript.Shell")
- Dim newTime
- Function openLogFile(N)
- Set objTextFile = objFSO.OpenTextFile(strDirectory & strFile, N, True)
- End Function
- Function extendTime(T)
- Call openLogFile(ForWriting)
- objTextFile.WriteLine(Date)
- objTextFile.WriteLine("0")
- objTextFile.WriteLine(T)
- objTextFile.Close
- End Function
- Function verifyID()
- If InputBox("Enter password.","Password Required") = "changethis" Then verifyID = True
- End Function
- If verifyID() = True then
- newTime = InputBox("Enter the amount of time in minutes." & vbcrlf & "This will override the current time remaining for the day and previous time extensions.","Set Usage Time")
- extendTime newTime
- objShell.Run checkTimeLeftVbs
- Else
- Msgbox "Authentication failure.", vbCritical
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement