Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting from Recycle Bin
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01110745
Message ID:
01110941
Views:
18
Hi Yuri,

I run your code in EXE under WinXPSP2 and it works but displays message box "Are you sure you want to delete ... ?" for each file. Try
*	oItem.InvokeVerb("&Delete")
       ERASE (oItem.Path)
>What could be the reason that the code below works if called as prg or exe from VFP command line with DO ... command, but it does not work if called from the Windows by clicking on exe file, or using ShellExec API from VFP command line?
>
>
>oShell= CreateObject("Shell.Application")
>do iDel_ALL_Contents with 10			&& Recycle Bin
>oShell=null
>RETURN
>*--------------------------------------
>Procedure iDel_ALL_Contents
>lPArameter lcdir
>LOCAL oItem
>FOR EACH oItem IN oShell.NameSpace(lcdir).Items
>
>* the line below does not work if the program called as EXE;
>*       no errors no messages, and it does not delete the file	
>
>	oItem.InvokeVerb("&Delete")
>
>ENDFOR
>WAIT clea
>RETURN
>*------------------------
>
>
>I know, there are other solutions to empty the Recycler. And they work. But I am interested in this particular solution. Thanks in advance.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform