473,664 Members | 2,728 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileSystemObjec t DeleteFolder Permission Denied

Dear all,

I have a script that creates a FileSystemObjec t to be used for
folder/directory manipulation. What I am trying to do is to search the
drive if folder exist. If it doesn't it creates a new folder, but if
the folder exists it deletes the old folder and creates a new one. The
error refers to the line where I am deleting the folder. Here is my
code:

zip_path = "C:\cd_buil d"

If fso.FolderExist s (zip_path & "\to_Zip") Then
error line -> fso.DeleteFolde r (zip_path & "\to_Zip" )
fso.CreateFolde r (zip_path & "\to_Zip" )
else
fso.CreateFolde r (zip_path & "\to_Zip" )
end if

And this is the error I am getting:

Microsoft VBScript runtime error '800a0046'

Permission denied

I have all the rights (full control) to the folder.

If I am trying to delete the folder in the Windows Explorer it gives
me and error for Sharing Violation. This foder is not used by any
other program, open anywhere else or anything.
I have no idea what is going on!!

Please somebody help me.

Thanks
Katja
Jul 19 '05 #1
4 13081
Is this folder shared?

Ray at work

"Katja" <ka**********@h otmail.com> wrote in message
news:a2******** *************** ***@posting.goo gle.com...
zip_path = "C:\cd_buil d"

If fso.FolderExist s (zip_path & "\to_Zip") Then
error line -> fso.DeleteFolde r (zip_path & "\to_Zip" ) I have all the rights (full control) to the folder.

If I am trying to delete the folder in the Windows Explorer it gives
me and error for Sharing Violation.

Jul 19 '05 #2
Hi Ray,
Yep, the folder is shared.
I tried to close the sessions and stuff as if it was thinking that the
folder was in use but still no joy.
Any other thoughts?

Katja

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message news:<OE******* *******@TK2MSFT NGP11.phx.gbl>. ..
Is this folder shared?

Ray at work

"Katja" <ka**********@h otmail.com> wrote in message
news:a2******** *************** ***@posting.goo gle.com...
zip_path = "C:\cd_buil d"

If fso.FolderExist s (zip_path & "\to_Zip") Then
error line -> fso.DeleteFolde r (zip_path & "\to_Zip" )

I have all the rights (full control) to the folder.

If I am trying to delete the folder in the Windows Explorer it gives
me and error for Sharing Violation.

Jul 19 '05 #3
Delete the share?

Ray at work
"Katja" <ka**********@h otmail.com> wrote in message
news:a2******** *************** ***@posting.goo gle.com...
Hi Ray,
Yep, the folder is shared.
I tried to close the sessions and stuff as if it was thinking that the
folder was in use but still no joy.
Any other thoughts?

Katja

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message

news:<OE******* *******@TK2MSFT NGP11.phx.gbl>. ..
Is this folder shared?

Ray at work

"Katja" <ka**********@h otmail.com> wrote in message
news:a2******** *************** ***@posting.goo gle.com...
zip_path = "C:\cd_buil d"

If fso.FolderExist s (zip_path & "\to_Zip") Then
error line -> fso.DeleteFolde r (zip_path & "\to_Zip" )

I have all the rights (full control) to the folder.

If I am trying to delete the folder in the Windows Explorer it gives
me and error for Sharing Violation.

Jul 19 '05 #4
Hi Ray,
Thanks for your reply but it didn't work either. The folder needs to
be shared so that user has read and write access to it.
I think the system somehow thinks that the folder is in use even it is
not.
The user did download the content of the folder just few secs earlier
so maybe there is a way to tell it that it has finished downloading
and then it would allow it to be deleted.

Any thoughts?

Thanks,
Katja
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1588
by: Mark | last post by:
I'm having intermittent trouble with the Scripting.FileSystemObject. Basically, I'm stress testing my ASP application and using the FSO to output lots of instrumentation/debug information to the same file. About 5 times within a 15 minute stress test, it returns "Permission Denied". I would think that this object is capable of asynchronous file open and writes. Has anyone else seen this issue and been able to resolve it?
1
4651
by: Scott MacLean | last post by:
I'm pulling my hair out over this one. I've got a web page that I need to have write to another server across the network. The site in question does NOT run in anonymous mode, that is, the user is presented with a username/password box when they view the page. No matter what I do, when the page attempts to access the remote server, I get a Permission Denied error. I have tried the suggestion from this page: ...
0
2715
by: bart plessers | last post by:
Hello, I want to list my folders with ASP. I use following script to achieve this: Set oFSO = Server.CreateObject("Scripting.FileSystemObject") Set oRoot = oFSO.GetFolder(Path) Set oFolders = oRoot.SubFolders for Each oFolder in oFolders Response.Write FolderDisplayName next
4
12390
by: Vilmar Brazão de Oliveira | last post by:
Hi, I got the err below, nevertheless my folders have full permissions for all. Permission denied /vilmar/ASP_JavaScript_CSS_HTML/ajudas_asp_completos/novo_asp/novo_asp_4-12- 03/Objeto_FileSystemObject.asp, line 17 Set objFSO = CreateObject("Scripting.FileSystemObject") Set Arquivo = objFSO.CreateTextFile("c:\Texto_teste.txt", True) Arquivo.WriteLine("Isto é um texto." & vbcrlf & "Outra linha do texto e " &
5
7337
by: Brad Wood | last post by:
The delete method of the FileSystemObject.FileObject does not return a result. If permissions disallow deletion, it will not raise an error. Conversely, if the delete method does succeed, a call to FileExists directly afterward may return true because the system hasn't updated yet (or whatever actually goes on). Is there any way to accurately check the result of a deletion?
4
3385
by: StumpY | last post by:
Hi I am trying to append information collected from a form into a text file (already created and currently in the root of my web) on my ISP's webserver. The code snippet causing the problem is; ...... 37 <% 38 Dim fso, f, TextFile 39 TextFile = Server.MapPath("mail.txt") 40 Const ForReading = 1, ForWriting = 2, ForAppending = 8 41 Set fso = Server.CreateObject("Scripting.FileSystemObject")
0
3195
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to the destination table(DB2). I get the following error when the package is executed: The execution of the following DTS Package succeeded: Package Name: PEX2-CopyQualDatatoDB2-UAT Package Description: (null) Package ID:...
0
3397
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have installed same application on another server Win 2003 R2 Std (No Active Directory). On that server I get “Permission denied” using the following code (used to zip folder content).
0
1219
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have installed same application on another server Win 2003 R2 Std (No Active Directory). On that server I get “Permission denied” using the following code (used to zip folder content). set WshShell = server.createobject("wscript.shell")
0
8437
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8861
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1759
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.