sakibomber
asked on
FileSystemObject -- Cant Create Object Error
Does anyone know why I get an error (Cant Create Object) when I try this???
fs= CreateObject(Scripting.Fil eSystemObj ect)
I need to create a file system object in order to delete certain files requested by the user. This seems to be ok until I bundle my app with FailSafe. I receive a failsafe error that states that I cant create the object.
thanks,
saki
fs= CreateObject(Scripting.Fil
I need to create a file system object in order to delete certain files requested by the user. This seems to be ok until I bundle my app with FailSafe. I receive a failsafe error that states that I cant create the object.
thanks,
saki
oops - you also need a Set:
Set fs = CreateObject("Scripting.Fi leSystemOb ject")
(see what happens when you type too fast? :-)
Set fs = CreateObject("Scripting.Fi
(see what happens when you type too fast? :-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
download & install a component from link
http://www.microsoft.com/scripting/downloads/v55/windows2000/scripten.exe
http://www.microsoft.com/scripting/downloads/v55/windows2000/scripten.exe
A much easier way to delete files, without any additional components such as FSO is to simply use "Kill".
Ex.
Kill "C:\Temp\for.txt"
This is an intrinsic VB command so as long as you have the VB run-time engine (which is required to run your app) then this functionality is available.
the only minor issue is that you should include error-trapping in case the delete fails.
Ex.
Kill "C:\Temp\for.txt"
This is an intrinsic VB command so as long as you have the VB run-time engine (which is required to run your app) then this functionality is available.
the only minor issue is that you should include error-trapping in case the delete fails.
kishore1977,
Is that the best you can do? Copy someone else's answer? This may be your first day on EE, but that is not the way we do it here.
Do yourself a favor and re-read the EE Guidelines (https://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp) regarding posting answers as comments.
Anthony
Is that the best you can do? Copy someone else's answer? This may be your first day on EE, but that is not the way we do it here.
Do yourself a favor and re-read the EE Guidelines (https://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp) regarding posting answers as comments.
Anthony
kishore1977, I can't help but laugh. I've seen people copy and then re-state a possible answer in their own words, but yours was a verbatim copy. All I can think is that you liked my comment so much that you wanted to submit it as an answer.
I'm honored!
However, as Anthony pointed out, that's not the proper way to use Experts Exchange. Welcome aboard and I hope you'll be more careful next time. (FYI, most experts will only use the Comment button since they realize that their answers may only be part of what the questioner is seeking.)
I'm honored!
However, as Anthony pointed out, that's not the proper way to use Experts Exchange. Welcome aboard and I hope you'll be more careful next time. (FYI, most experts will only use the Comment button since they realize that their answers may only be part of what the questioner is seeking.)
ASKER
Sorry for the delay.......Ive gotta reject your proposed solution kishore. Sorry but its only fair.
ASKER
Thank you...sorry for the delayed response. :)
saki
saki
sakibomber, thanks for the "A", and thanks for getting back to this Q.
fs = CreateObject("Scripting.Fi