-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogonTime.vbs
More file actions
32 lines (27 loc) · 908 Bytes
/
Copy pathLogonTime.vbs
File metadata and controls
32 lines (27 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'******************************************************************************
'
' This script was designed for student logons in the New Horizons
' Mentored Learning Center. It creates a simple text file called
' LogonTime in the user's profile and adds a time stamp that can
' be harvested by ProfileScan2.vbs.
'
' Shawn Stugart
' 9-6-2006
'
'******************************************************************************
Option Explicit
Dim oShell, oEnv, oFSO, sUserLog, oFile
Const ForWriting = 2
Set oShell = CreateObject("WScript.Shell")
Set oEnv = oShell.Environment("Process")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sUserLog = oEnv("USERPROFILE") & "\LogonTime"
If oFSO.FileExists(sUserLog) Then
Set oFile = oFSO.OpenTextFile(sUserLog, ForWriting)
oFile.WriteLine(Now)
oFile.Close
Else
Set oFile = oFSO.CreateTextFile(sUserLog)
oFile.WriteLine(Now)
oFile.Close
End If