furtivevole
Technical User
Hi
When a certain .asp page is opened, I need to check if a specific client-side folder already exists, and then ask the user whether it (and its contents) should be deleted or remain.
Intranet application, all users have IE, mainly W2K.
Error is: ActiveX component can't create object.
Can someone advise please?
[tt]<script language="vbscript">
sub window_onload
dim ProdFolder, msg, sys, fol, foldate, rtnval
ProdFolder = "C:\hardcoded_path"
set sys = CreateObject( "Scripting.FileSystemObject" )
if sys.FolderExists( ProdFolder ) Then
set fol = sys.GetFolder( ProdFolder )
foldate = fol.DateCreated
msg = "The destination folder already exists. It was created on " & foldate
msg = msg + chr(10) & "Would you like me to delete it now? "
rtnval = msgbox(msg, 52, ProdFolder)
if rtnval = vbYes then
sys.DeleteFolder (ProdFolder)
rtnval = msgbox("Folder deleted!",48,ProdFolder)
else
rtnval = msgbox("Previous folder remains on local drive",48,ProdFolder)
end if
end if
set sys=nothing
set ProdFolder=nothing
end sub
</script>[/tt]
When a certain .asp page is opened, I need to check if a specific client-side folder already exists, and then ask the user whether it (and its contents) should be deleted or remain.
Intranet application, all users have IE, mainly W2K.
Error is: ActiveX component can't create object.
Can someone advise please?
[tt]<script language="vbscript">
sub window_onload
dim ProdFolder, msg, sys, fol, foldate, rtnval
ProdFolder = "C:\hardcoded_path"
set sys = CreateObject( "Scripting.FileSystemObject" )
if sys.FolderExists( ProdFolder ) Then
set fol = sys.GetFolder( ProdFolder )
foldate = fol.DateCreated
msg = "The destination folder already exists. It was created on " & foldate
msg = msg + chr(10) & "Would you like me to delete it now? "
rtnval = msgbox(msg, 52, ProdFolder)
if rtnval = vbYes then
sys.DeleteFolder (ProdFolder)
rtnval = msgbox("Folder deleted!",48,ProdFolder)
else
rtnval = msgbox("Previous folder remains on local drive",48,ProdFolder)
end if
end if
set sys=nothing
set ProdFolder=nothing
end sub
</script>[/tt]