Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't delete a folder that starts with a space.
Message
Information générale
Forum:
Windows
Catégorie:
Dépannage
Divers
Thread ID:
00495553
Message ID:
00495642
Vues:
18
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!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform