GuitarguyMoseng
Member
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 = fspenTextFile(fullPath, ForReading, True)
Set tempFile= fspenTextFile(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
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 = fspenTextFile(fullPath, ForReading, True)
Set tempFile= fspenTextFile(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