Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't delete a folder that starts with a space.
Message
General information
Forum:
Windows
Category:
Troubleshooting
Miscellaneous
Thread ID:
00495553
Message ID:
00495642
Views:
19
Hi Ed,

Thanks for the help, but it couldn't delete it. The actual folder structure is
"C:\Documents and Settings\Roi\My Documents\Projects\US Concrete\Drainage"
"C:\Documents and Settings\Roi\My Documents\Projects\US Concrete\Drainage\TestProjects"
"C:\Documents and Settings\Roi\My Documents\Projects\US Concrete\Drainage\TestProjects\ - "
I changed your code slightly to start at the "drainage" folder and then removed the test, so it would delete all the subfolders.
oFSO = CREATEOBJ('Scripting.FileSystemObject')
oFSCRoot = oFSO.GetFolder('C:\Documents and Settings\Roi\My Documents\Projects\US Concrete\Drainage')
FOR EACH oFolder IN oFSCRoot.SubFolders
      oFolder.Delete(.t.)
ENDFOR
I get this error: "OLE error code 0x800a004c. Unknown COM status code." when it tries to delete the parent of the " - " folder. Here is the wierd part, if I start on the parent "TestProjects", I don't get the error because it doesn't find a subfolder.

I tried a search at ms's site on that code and the only thing it finds is under "DirectShow" the following error: "CTL_E_PATHNOTFOUND The function attempted to access a file with an incorrect path."

When I try to delete it from explorer I get the error "Cannot delete file: Cannot read from the source file or disk." I can't do anything with it, copy, rename, etc... I always get that same error.

>I haven't tried this, but what about using the FSO as follows (VFP):
>
>
oFSO = CREATEOBJ('Scripting.FileSystemObject')
>oFSCRoot = oFSO.GetFolder('C:\')
>FOR EACH oFolder IN oFSCRoot.SubFolders
>   IF oFolder.Name = ' - '
>      oFolder.Delete(.t.)
>   ENDIF
>ENDFOR
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform