HOW to DELETE an INVALID folder 
Author Message
 HOW to DELETE an INVALID folder

I succeeded in creating an INVALID Win2K folder using the FileSystemObject
in script.
Normaly, folders should not start with a "blank space" (char 32), nor should
they end with a "blank space" (char 32)

When you create a folder name in the explorer, leading and trailing spaces
are trimmed automatically.
However, using the FileSystemObject, it is possible to create such a folder
using:
   FSO.CreateFolder("   -  ")

Trying to delete that folder afterwards, using the explorer is not possible
Error deleteing file or folder: Cannot delete file: Cannot read from the
source file or disk.

Nor can it be removed afterwards using the FileSystemObject method
    FSO.DeleteFolder("    -  ")

When viewing the properties of that yellow folder in the explorer, it only
shows
- the "general" tab
but it doesn't show
- the "security" tab
as for normal folders

Since I can, put folders and files in it, I suppose it is a folder...
Having full administrator permissions on the parent folder doesn't help...
(there is no security tab on the bad folder...)
When I try to force to set permissions using the parent folder and checking
the Advanced option: Reset permissions on all child objects and enable
propagation of inhertible permissions, I get the error: An error occurred
applying security information to C:\blablabla\   -  .The system cannot find
the file specified...

Retrying all this after restarting the machine doesn't help either...

How can I delete that folder ?

TIA
Joost Devos



Tue, 27 Apr 2004 02:09:02 GMT  
 HOW to DELETE an INVALID folder
Have you tried executing rmdir from the command prompt? It accepts folder
names in quotes ("). Don't forget to specify the ***exact*** spelling of the
folder name.

Richard.



Tue, 27 Apr 2004 02:30:38 GMT  
 HOW to DELETE an INVALID folder
Hi Joost,
I had that problem before in my old DOS days.
I seem to remember that there was a way to delete specific files this way.
Let's say the file was called " File.ext" (notice leading blanc). So to
delete it : del *file.ext which deleted all files ending with "file.ext".
You had to watch out because other file names might end that way.
To delete a folder the Dos command is "rd" so for your folder:
rd *-*
Watch out, this will delete all folders with a hyphen. But you could rename
the other folders while doing this operation.
Hope somebody else can give you a better solution. If not, maybe somebody
could improve mine.

Good luck.


Quote:
> I succeeded in creating an INVALID Win2K folder using the FileSystemObject
> in script.
> Normaly, folders should not start with a "blank space" (char 32), nor
should
> they end with a "blank space" (char 32)

> When you create a folder name in the explorer, leading and trailing spaces
> are trimmed automatically.
> However, using the FileSystemObject, it is possible to create such a
folder
> using:
>    FSO.CreateFolder("   -  ")

> Trying to delete that folder afterwards, using the explorer is not
possible
> Error deleteing file or folder: Cannot delete file: Cannot read from the
> source file or disk.

> Nor can it be removed afterwards using the FileSystemObject method
>     FSO.DeleteFolder("    -  ")

> When viewing the properties of that yellow folder in the explorer, it only
> shows
> - the "general" tab
> but it doesn't show
> - the "security" tab
> as for normal folders

> Since I can, put folders and files in it, I suppose it is a folder...
> Having full administrator permissions on the parent folder doesn't help...
> (there is no security tab on the bad folder...)
> When I try to force to set permissions using the parent folder and
checking
> the Advanced option: Reset permissions on all child objects and enable
> propagation of inhertible permissions, I get the error: An error occurred
> applying security information to C:\blablabla\   -  .The system cannot
find
> the file specified...

> Retrying all this after restarting the machine doesn't help either...

> How can I delete that folder ?

> TIA
> Joost Devos



Tue, 27 Apr 2004 02:35:25 GMT  
 HOW to DELETE an INVALID folder
Thanks a lot Richard and Raymond !!!!

What I had to do to make it work under the command prompt was:
- go to the "parent folder" of the folder that contains the INVALID folder
- issue the command as follows: RD /S /Q "parent folder name"
  (subdirectories /S and quiet /Q)

It was impossible to remove the INVALID folder from within the direct parent
folder !

It is possible to create folders with spaces under the command prompt using
MKDIR "    -  " and these folders can be deleted using RD "    -  "

Thanks again
Joost


Quote:
> I succeeded in creating an INVALID Win2K folder using the FileSystemObject
> in script.
> Normaly, folders should not start with a "blank space" (char 32), nor
should
> they end with a "blank space" (char 32)

> When you create a folder name in the explorer, leading and trailing spaces
> are trimmed automatically.
> However, using the FileSystemObject, it is possible to create such a
folder
> using:
>    FSO.CreateFolder("   -  ")

> Trying to delete that folder afterwards, using the explorer is not
possible
> Error deleteing file or folder: Cannot delete file: Cannot read from the
> source file or disk.

> Nor can it be removed afterwards using the FileSystemObject method
>     FSO.DeleteFolder("    -  ")

> When viewing the properties of that yellow folder in the explorer, it only
> shows
> - the "general" tab
> but it doesn't show
> - the "security" tab
> as for normal folders

> Since I can, put folders and files in it, I suppose it is a folder...
> Having full administrator permissions on the parent folder doesn't help...
> (there is no security tab on the bad folder...)
> When I try to force to set permissions using the parent folder and
checking
> the Advanced option: Reset permissions on all child objects and enable
> propagation of inhertible permissions, I get the error: An error occurred
> applying security information to C:\blablabla\   -  .The system cannot
find
> the file specified...

> Retrying all this after restarting the machine doesn't help either...

> How can I delete that folder ?

> TIA
> Joost Devos



Tue, 27 Apr 2004 04:12:48 GMT  
 HOW to DELETE an INVALID folder
We have tried two methods below to delte the invalid folder created by FSO,
and neither of them worked, instead, "The system cannot find the file
specified" error occurred.

1. WScript.run

Set wshShell = CreateObject("Wscript.Shell")
dim a
a = "rmdir " + """ - """
wshShell.run "rmdir " + a

2. FSO.DeleteFolder

The only worked mwthod is to use the DOS Command, rmdir " - " at DOS Prompt
window.

Regards,

This posting is provided ?AS IS?, with no warranties, and confers no
rights.



Sat, 01 May 2004 15:07:03 GMT  
 HOW to DELETE an INVALID folder


Quote:
> We have tried two methods below to delte the invalid folder created by
FSO,
> and neither of them worked, instead, "The system cannot find the file
> specified" error occurred.

> 1. WScript.run

> Set wshShell = CreateObject("Wscript.Shell")
> dim a
> a = "rmdir " + """ - """
> wshShell.run "rmdir " + a

1. Drop one of the, "rmdir".
   In other words... ["rmdir " + a] = [rmdir rmdir " - "]

2. wshShell.run expects a program. "rmdir" is an internal command of a
command processor, not a program name. Try using...

wshShell.run "command.com /c " + a

or better yet...

wshShell.run "%comspec% /c rmdir " + """ - """, vbHide

Quote:

> 2. FSO.DeleteFolder

> The only worked mwthod is to use the DOS Command, rmdir " - " at DOS
Prompt
> window.

3. Use the suggested work around above.

--
Todd Vargo (body of message must contain my name to reply by email)



Sun, 02 May 2004 08:31:31 GMT  
 HOW to DELETE an INVALID folder
I have tried to use MKDIR " -" and RD " - " and it worked. I don't what
problem you are encountering now.

Regards,

This posting is provided ?AS IS?, with no warranties, and confers no
rights.



Fri, 07 May 2004 19:00:25 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. HOW to DELETE an INVALID folder

2. HOW to DELETE an INVALID folder

3. Creating / Deleting Folders and files

4. Delete a folder using VBS

5. Permission denied deleting a folder using VBScript

6. Delete Empty Folders

7. How delete all files in a given folder ?

8. How delete empty folder with vbscript

9. Find files in a folder and delete them if older then 2 dayx

10. How delete a folder with VBScript

11. Outlook Empy 'Deleted Items Folder'

12. delete a folder

 

 
Powered by phpBB® Forum Software