Hello,
Is there way to programmatically empty recycle bin on the computer that runs Ignition client?
This method doesn’t work:
import winshell
winshell.recycle_bin().empty(confirm=False, show_progress=False, sound=False)
There is no winshell module within Ignition.
Wondering if there is other way to do it?
Thank you,
Peter,
Modern Windows will give you a UAC prompt before successfully removing anything from the recycle bin, so I doubt this will work, but you could try system.util.execute
combined with one of the methods from this post: https://www.windows-commandline.com/empty-recycle-bin-command-line/
Yeah, those methods don’t work thru system.util.execute
. Thanks for looking into this Paul @paul-griffith .
I may just configure recycle bin to not accept anything, should work for the application.
I like this one, personally.
On a PC running Windows 10, when you delete a file by choosing a file and hitting the Delete key, or right-clicking on file and then clicking Delete
Est. reading time: 2 minutes
1 Like
You’ll need to execute it via CMD:
system.util.execute(["cmd", "/c rmdir /q /s %systemdrive%\$Recycle.bin"])
1 Like