I know I need to dissconnect drive w before I run this script..what is the syntax to do this...I've tried and can't figure it out since I'm new to vbscript. Here is my script this far.
ONST ForAppending = 8
reason = InputBox("Why are you accessing the server? Please give a reason. note: A blank response will be questioned by OMNB management!","Authorized Personnel Only!!!!")
Set fso = CreateObject("Scripting.FileSystemObject")
Set WSHNetwork = CreateObject("Wscript.Network")
WSHNetwork.MapNetworkDrive "w:", "\\*******\********",True
report = WSHNetwork.Username & " accessed the server at "& Now & " for the following reason:" & vbCrLf
report = report & reason & vbCrLf
If Not fso.FileExists("w:\sunshineserverlogin.txt") Then
fso.CreateTextFile ("w:\serverlogin.txt")
End If
Set ts = fs
penTextFile ("w:\sunshineserverlogin.txt", ForAppending)
ts.write report
ONST ForAppending = 8
reason = InputBox("Why are you accessing the server? Please give a reason. note: A blank response will be questioned by OMNB management!","Authorized Personnel Only!!!!")
Set fso = CreateObject("Scripting.FileSystemObject")
Set WSHNetwork = CreateObject("Wscript.Network")
WSHNetwork.MapNetworkDrive "w:", "\\*******\********",True
report = WSHNetwork.Username & " accessed the server at "& Now & " for the following reason:" & vbCrLf
report = report & reason & vbCrLf
If Not fso.FileExists("w:\sunshineserverlogin.txt") Then
fso.CreateTextFile ("w:\serverlogin.txt")
End If
Set ts = fs
ts.write report