Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot delete directories
Message
From
19/10/2000 00:27:23
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00412707
Message ID:
00431315
Views:
13
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform