Ok so here is what is going on. I have created a scrpit to take you to a webpage, and autoinput the login information you enter. It runs off of date and it makes a marker of a text fiel to check toi see if the script has ran. It will delete the file on a certain day. All that works, except wehn I put the file creation code at the bottom it will not create the text file. When I put it at the top it will, but then it becomes mute because the script checks for the file and if it is not there it will run. Any ideas? Oh and I really dont know VB scripttoo well, I have Frankenstiened this code together for other places so it is really ugly sorry.
START CODE--------
'set day and search for text file, if it is either the day or file does not exist run
IF Day(NOW())= 27 OR objFSO.FileExists(strfile) = False then
'' Display a URL
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
With IE
.left=100
.top=100
.height=600
.width=600
.menubar=0
.toolbar=1
.statusBar=0
.navigate "about:blank"
.visible=1
End With
With IE.document
.Open
.WriteLn "<HTML><HEAD>"
.WriteLn "<TITLE>**** REQUIRED!</TITLE></HEAD>"
.WriteLn "<BODY>"
.WriteLn "<b> **** Policy requires you to update your personal information NOW. Please log in! In 10 seconds your log in will be on the screen. PLEASE LOG IN!</b>"
.WriteLn "</BODY>"
.WriteLn "</HTML>"
.Close
WScript.Sleep 10000
End With
'Inputboxes
'' Display a URL
Dim IE2
Set IE2 = CreateObject("InternetExplorer.Application")
With IE
.left=0
.top=0
.height=1000
.width=1000
.menubar=0
.toolbar=1
.statusBar=0
.navigate "
MY SERVER LOCATION"
.visible=1
Dim fname
fname=InputBox("YOU MUST UPDATE YOUR PERSONAL INFORMATION: Please Enter Your Network User Name:", "**** REQUIRED" )
pname=InputBox("YOU MUST UPDATE YOUR PERSONAL INFORMATION: Please Enter Your Network Password:", "**** REQUIRED" )
With IE.Document
.getElementByID("txtUserName").value = fname
.getElementByID("txtPassword").value = pname
.getElementByID("btnLogIn").click
End With
End With
'wait a while until IE as finished to load
Set IE = Nothing
'creation of marker text
strFolder = "C:\UPDATE"
strFile = "C:\UPDATE\UPDATE.TXT"
set objFSO = createobject("Scripting.FileSystemObject")
set objFile = objFSO.CreateTextFile("C:\UPDATE\UPDATE.TXT")
if objFSO.FolderExists(strFolder) = False then
objFSO.CreateFolder strFolder
end IF
IF objFSO.FileExists(strfile) = False then
objFile strfile
end if
WScript.Quit(0)
END IF
END CODE--------
Thanks