123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
Kill Statement

--------------------------------------------------------------------------------

Description : The Kill statement deletes files. The required pathname argument must be absolute and include the drive letter. This supports the use of the wildcard character * to delete mulitple files.

example usage:
Deletes file.txt In directory New Folder off C drive's root.
<% Kill "C:New Folderfile.txt" %>

Deletes file.txt In directory New Folder off the server's root.
<% Kill Server.MapPath("/New Folder/file.txt") %>

Deletes all files In directory New Folder off the C drive's root.
<% Kill "C:New Folder*" %>

Deletes all files In directory New Folder off the server's root.
<% Kill Server.MapPath("/New Folder") & "*" %>
source code:
<%
Private Sub Kill(ByVal pathname)
Dim objFSO, boolErr, strErrDesc
On Error Resume Next
Set objFSO = Server.CreateObject("scripting.filesystemobject")
objFSO.DeleteFile pathname
If Err Then
boolErr = True
strErrDesc = Err.description
End If
Set objFSO = Nothing
On Error GoTo 0
If boolErr Then Err.Raise 5102, "Kill Statement", strErrDesc
End Sub
%>
--------------------------------------------------------------------------------

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG