Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Argh! Delete A Directory 1

Status
Not open for further replies.

TonyRosen

Programmer
Jul 28, 2003
108
US
I am receiving an error while trying to delete a directory off of my site using my ASP page ... my code is:

<%
set fso = createobject(&quot;scripting.filesystemobject&quot;)
serverpath = &quot;c:\fullpath\&quot; & strclientdirectory
set f = fso.deletefolder(Server.Mappath(serverpath))
set fso = nothing
%>

ERROR:
Object required: 'fso.deletefolder(...)'

it deletes the folder and then gives me this error... why/what/how?
 
except that using &quot;fso.deletefolder(serverpath)&quot; gives me a &quot;path not found&quot; error ... and, it still deletes the thing ......... either way, it deletes the file, it just doesn't like doing it without the error.
 
<%
set fso = createobject(&quot;scripting.filesystemobject&quot;)
serverpath = &quot;c:\fullpath\&quot; & strclientdirectory
If fso.FolderExists(serverpath) = True The
fso.deletefolder(serverpath)
end if
set fso = nothing
%>

 
PERFECT!!!!!!!

i knew it would be something stupidly simple ....

once again ... you guys rock ....
 
And just to mark this post as helpful/expert. I'm giving good old GaryC123 a
star.gif
on your behalf TonyRosen

pinky1.jpg width='75' height='75'
[/tt]
056.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top