Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

Scripts If you need or have any scripts then get 'em here.

Go Back   EduGeek.net Forums > Coding and Web Development > Scripts
Reply
 
LinkBack Thread Tools Search Thread
Sponsored Links
Old 31-03-2008, 11:14 AM   #1
 
placky's Avatar
 
Join Date: Feb 2008
Location: N wales
Posts: 20
uk uk wales
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0 placky is an unknown quantity at this point
Default VBScript and 'Scripting.filesystemobject'

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.

Code:
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
????: EduGeek.net Forums http://www.edugeek.net/forums/scripts/17425-vbscript-scripting-filesystemobject.html

activex component can't create object:'Scripting.filesystemobject' in line 3 char1

Anyone have any ideas at a total loss here!
  Reply With Quote
Old 31-03-2008, 01:22 PM   #2
 
binky's Avatar
 
Join Date: Sep 2006
Posts: 218
uk
Thanks: 0
Thanked 10 Times in 10 Posts
Rep Power: 8 binky will become famous soon enough
Default

Try reinstalling Windows Scripting Host on the computer.
  Reply With Quote
The Following User Says Thank You to binky For This Useful Post:
placky (01-04-2008)
Old 31-03-2008, 02:35 PM   #3
 
m2d2's Avatar
 
Join Date: Jan 2007
Location: Enfield, London
Posts: 153
uk
Thanks: 6
Thanked 2 Times in 2 Posts
Rep Power: 7 m2d2 is on a distinguished road
Default

Quote:
Originally Posted by placky View Post
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.
  Reply With Quote
Old 01-04-2008, 04:49 PM   #4
 
placky's Avatar
 
Join Date: Feb 2008
Location: N wales
Posts: 20
uk uk wales
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0 placky is an unknown quantity at this point
Default

Thanks for the help Binky and m2d2!

A reinstall of the Scripting Host fixed it

Regards

Gareth
  Reply With Quote
Reply
Similar Threads
Thread Thread Starter Forum Replies Last Post
VBScript IDE + Debugger Geoff Scripts 4 13-09-2007 08:56 PM
VBScript / SQL Server Gatt Scripts 5 23-05-2007 02:12 PM
another VBScript question! StewartKnight Coding 4 03-05-2007 05:41 PM
FileSystemObject Folder why permission denied NetworkGeezer Coding 15 03-05-2007 05:34 PM
VBScript StewartKnight Coding 5 01-05-2007 11:04 AM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:46 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright EduGeek.net




website uptime

© 2005 - 2009 EduGeek.net
no new posts