Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting files Content.IE5
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01195676
Message ID:
01196820
Vues:
13
Hi, I have tried adding Try Catch Finally. But what happens is that VFP9 gets to
the first file. It displays "trying to delete filename" and then simply freezes.
I have to use control alt delete to stop it. Any suggestions around this problem
of deleting these files?
Thanks
Steve
oFSO = CreateObject('Scripting.FileSystemObject')
oFolder = oFSO.GetFolder('C:\Documents and Settings\sje\Local Settings\Temporary Internet Files\Content.IE5\')
oSubFolders = oFolder.SubFolders
FOR EACH oSubFolder IN oSubFolders
  mm= oSubFolder.Path
?? " ",osubfolder.Files.Count
  oFiles = oSubFolder.Files
  FOR EACH oFile IN oFiles
	nn= oFile.path
	        TRY
  		   ? "trying to delete ->  " + JUSTFNAME(nn)
		   oFile.Delete()
		   READ EVENTS
		CATCH TO oException
		   ? "Catching an exception"
		   IF oException.ErrorNo = 1
		      STRTOFILE("Error occurred at: " + TRANSFORM(DATETIME());
		         + CHR(13),"C:\Errors.log",.T.)
		   ENDIF
		FINALLY
		   ? "Clearing events"
		   CLEAR EVENTS
		ENDTRY
  ENDFOR
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform