sandboxie-plus / Sandboxie

Sandboxie Plus & Classic
https://Sandboxie-Plus.com
GNU General Public License v3.0
13.69k stars 1.52k forks source link

Is there an alternative for the legacy DeleteCommand? #591

Closed nik-gr closed 2 years ago

nik-gr commented 3 years ago

As I understand from #343 the reason some things did not work as expected on my system is because DeleteCommand is not available (if that is mentioned on release notes I failed to locate it).

I do not use it for secure delete, there are some actions I want to happen everytime some sandboxes are closing before auto deleting and I was using that setting to run a bat file performing those actions and then deleting contents.

Is there a way to do it with sandbox-plus? If not, since there is already a mechanism for auto deleting I am guessing it won't be much different to implement an option where users can give an extra command/batch file to run after a sandbox terminates (and before auto deleted if that setting is enabled). Will it be possible to provide an option like this?

DavidXanatos commented 3 years ago

There is currently no such option, but I see how that could be useful in certain cases. I will add such an ability to the plus UI.

Also whats your exact use case? You probably know that the original sbie messes the folder structure up (sometimes) before invoking that command. The purpose is to remove possible re parse points, reserved or invalid file names, and paths that are to long.

The new feature will allow the user to specify a command to be invoked before any modification to the box folder structure in preparation of deletion occurs so it should be an improvement :)

nik-gr commented 3 years ago

Hi, I didn't have any such issues, are you referring to the step where the sandbox folder gets a random suffix? If it is about that I was passing %SANDBOX% as an argument to the bat file, using that to locate files in it.

Use cases,for example I'm using it to save configuration settings of some programs that do it in registry, instead of trying to locate what happens where and still pollute my main registry, very easily and simply I save sandboxe's reghive and bring it back before I start it again. An other example is to hide (by temporarily renaming) some x.exe from sandbox 1 while sandbox 2 is running because it could create conflicts on some shared files and when sandbox 2 closes to bring back to its original name x.exe I have a few more use cases in case you are interested I can check them out but as far as I remember they are for saving settings or disabling firewall rules

Thanks for implementing it!

wshyang commented 2 years ago

I was kinda surprised we didn't have DeleteCommand working on the Plus version too, any chance we can have this feature back? :)

DavidXanatos commented 2 years ago

there is a new Triggers tab in the advanced options since v1.0.10 that will allow to specify commands to be run unboxed just before a box content gets deleted.

upload_2022-8-13_8-39-28

Should be something like this:

From UI: Code:

"C:\Users\Test\YourFolder\SDelete\sdelete.exe" -p 3 -s -q "X:\Sandbox\%USER%\%SANDBOX%"

OR

From Edit ini Section: Code:

OnBoxDelete="C:\Users\Test\YourFolder\SDelete\sdelete.exe" -p 3 -s -q "X:\Sandbox\%USER%\%SANDBOX%"

Original reference: https://www.wilderssecurity.com/threads/sandboxie-plus-secure-delete.446692/#post-3098231