Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting files Content.IE5
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01195676
Message ID:
01196820
Views:
12
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform