Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot delete directories
Message
De
19/10/2000 00:27:23
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
À
05/09/2000 21:25:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00412707
Message ID:
00431315
Vues:
14
Ed, I wonder if you, or anyone else, has any other ideas. My problem is that there are a number of directories with one or more characters that look like a small:
_
|

in the name first 8 characters of the directory name. In response to your message:

*!* You might try using the Scripting.FileSystemObject;
*!* do a GetFolder() on the parent to return a FOlder object,
*!* and then iterate through the Folders collection,
*!* and deleting the funky directories:

I did the following:
oFSO = CREATEOBJ('Scripting.FileSystemObject')
IF Type( "oFSO" ) <> "O"
  WAIT WINDOW "Cannot create File System Object"
ELSE
  oParent = oFSO.GetFolder('C:\DelClient')
  IF Type( "oParent" ) <> "O"
    WAIT WINDOW "Cannot get folder C:\DelClient"
  ELSE
    FOR EACH oFolder IN oParent.SubFolders
      IF MessageBox( "Delete folder: " + ALLTRIM( oFolder.Name ) + "?", 1, "Confirm deletion" ) = 1
	oFolder.Delete(.T.)
      ENDIF
    ENDFOR
    oFolder = NULL
  ENDIF
  oFSO = NULL
ENDIF
That works FINE for normally named directories...I created a normally named directory, put it along with the bad ones under C:\DelClient, and this code did delete that one directory ONLY. Seems even WSH can't get to the misnamed directory.

Do you think I'm stuck telling the client that I can't delete these? Thanks for any additional input. J
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform