[SOLVED] logon VBScript problems (Pushed from Active Directory)

Hi guys.

So, I've made this simple little logon-script to change a few settings in Mozilla Firefox. It works fine in my lab environment, but when I push the script from the DC, it gives me error "object variable not given" on line 96. If I run the script by itself there are no errors.

Const ForReading = 1
Const ForWriting = 2
Dim editTokenHomepage
editTokenHomepage = 0
Dim editTokenCheckDefaultBrowser
editTokenCheckDefaultBrowser = 0
Set objFile = fso_OpenTextFile(fullPath, ForReading, True)
Set tempFile= fso_OpenTextFile(filePath & ".tmp", ForWriting, True)

The start of this while loop is line 96.

Do While Not objFile.AtEndofStream
myLine = objFile.ReadLine
If InStr(myLine, "user_pref(""browser.startup.homepage"",") Then
myLine = "user_pref(""browser.startup.homepage"", " + homepage + ");"
editTokenHomepage = 1
End If
If InStr(myLine, "user_pref(""browser.shell.checkDefaultBrowser"",") Then
myLine = "user_pref(""browser.shell.checkDefaultBrowser"", " + checkDefaultBrowser +");"
editTokenCheckDefaultBrowser = 1
End If
tempFile.WriteLine myLine
' CLOSING OBJECT FILE
' IF NOT CLOSED, NEXT FUNCTION IN SCRIPT WILL READ OBJECT
' FILE AS "END OF STREAM". THIS LEADS TO LOOP EXIT
objFile.Close
Loop

Thnx in advance,
Mr. Moseng
 
Figured it out... Stupid me put the objFile.Close INSIDE the while loop xD Haha, no wonder this messed up. Can't close the object file every time I try to run the while loop... *getting more coffee*

Cheers,
Mr. Moseng
 
Top