placky Posted March 31, 2008 Posted March 31, 2008 Morning everyone I have set the following VBS script to run when our computers start up along with delprof.exe to get rid of any locally cached profiles. Const LocalDocumentsFolder = "C:\Documents and Settings\" set objFSO = createobject("Scripting.FileSystemObject") set objFolder = objFSO.GetFolder(localdocumentsfolder) for each fldr in objFolder.SubFolders if not isexception(fldr.name) then objFSO.DeleteFolder fldr.path, True end if next Function isException(byval foldername) select case foldername case "All Users" isException = True case "Default User" isException = True case "LocalService" isException = True case "NetworkService" isException = True case "Administrator" isException = True case Else isException = False End Select End Function it works perfectly on all our computers and even our terminal servers, well all except one! Its a terminal server running windows 2003 R2 and I get the following error activex component can't create object:'Scripting.filesystemobject' in line 3 char1 Anyone have any ideas at a total loss here!
binky Posted March 31, 2008 Posted March 31, 2008 Try reinstalling Windows Scripting Host on the computer. 2
m2d2 Posted March 31, 2008 Posted March 31, 2008 activex component can't create object:'Scripting.filesystemobject' in line 3 char1 Anyone have any ideas at a total loss here! Are you using seperate copies on each machine of the same script. You may need to check how exactly you spelt Scripting.FileSystemObject. The only may I could get the same error was to mistype the name of the object between the quote marks.
placky Posted April 1, 2008 Author Posted April 1, 2008 Thanks for the help Binky and m2d2! A reinstall of the Scripting Host fixed it Regards Gareth
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now