Page 1 of 2
An external equivalent for "Auto Exec"
Posted: Tue Mar 04, 2008 7:21 am
by lwc
Since "Auto Exec" is an internal command (within the sandbox's scope), I don't manage to
duplicate sandboxes with it.
All I need is a Sandboxie "start up" command that does something externally before creating the sandbox.
Posted: Tue Mar 04, 2008 7:26 am
by SnDPhoenix
Maybe use a batch file, or code a AutoIt script to do what you want?
Posted: Tue Mar 04, 2008 7:52 am
by lwc
What do you mean run a batch file...? I need a Sandboxie "start up" command that would run anything, whether it's a batch file or not.
Just like "Delete Command" is an external command.
Posted: Tue Mar 04, 2008 9:07 am
by tzuk
AutoExec does indeed run sandboxed programs. Maybe you can workaround that using OpenFilePath settings that will be limited to the program that you're running via AutoExec?
Posted: Tue Mar 04, 2008 9:56 am
by lwc
Why not just an unsandboxed AutoExec? Just a "Startup Command" that will work like "Delete Command".
Posted: Tue Mar 04, 2008 12:03 pm
by tzuk
Well, I don't think there is a need for an unsandboxed AutoExec. I suggested you use OpenFilePath, can you explain why you feel it isn't going to help?
Posted: Tue Mar 04, 2008 3:55 pm
by lwc
Maybe you can workaround that using OpenFilePath settings that will be limited to the program that you're running via AutoExec?
No, because the program I'm running is CMD - as I wrote above, in order to duplicate sandboxes.
Duplicating sandboxes is the reason why it's needed.
Posted: Tue Mar 04, 2008 4:02 pm
by tzuk
I still don't understand. What's the problem? Can't you write a batch file that will copy anything from (OtherSandbox)\drive\c\* to c:\
and then (OtherSandbox)\drive\d\* to d:\
and so on?
Posted: Tue Mar 04, 2008 4:27 pm
by lwc
I've tried it and the xcopy kept failing. Also, since it's internal, how will I copy the registry settings that Sandboxie saves as files?
If you saw what I did with "Delete Command", then you know how easy it is with an external command (especially when you know about %A
).
Posted: Wed Mar 05, 2008 6:17 am
by tzuk
I already described how to use registry export/import functions to populate the sandboxed registry. As for XCOPY, I really see no reason why it shouldn't work. So as I said earlier, I still don't see a reason to add an unsandboxed AutoExec, just because you are having some small problem with XCOPY that you have not yet resolved.
Posted: Wed Mar 05, 2008 7:55 am
by lwc
It's really not the same to xcopy multiple folders + exporting registry + importing registry as opposed to just use a single (external) command.
In any case, please move this topic into feature request. I've changed the subject of this topic to reflect Sandboxie currently doesn't have such a thing. Thanks.
Posted: Thu Feb 04, 2010 9:44 am
by lwc
I was thinking about this lately because I have a 130 Mb sandbox (which means 260 Mb when resorting to "Delete Command").
You said to use OpenFilePath, but keep in mind I need to copy RegHive & RegHive.LOG. Besides, doesn't Auto Exec only run after they're already created?
Another issue is that environmental variables only work for settings and not for the sandbox itself. So "%Sandbox%" is not useable for Auto Exec.
I just want to copy mysandbox_dummy into mysandbox before mysandbox starts. An external Auto Exec would just be "copy mysandbox_dummy mysandbox". Yes, I realize I can start Sandboxie through a third party (e.g. a batch file), but it'll never be the same thing. If Sandboxie already has the foundation for the external "Delete Command", why not doing the same thing for sandboxes' restarts (i.e. an external "Auto Exec")?
Posted: Thu Feb 04, 2010 10:25 am
by tzuk
You can't copy over the reghive files of a sandbox if your program is running in that same sandbox. You will have to use registry import/export commands to populate the sandboxed registry.
I could add %sandbox% for AutoExec processing, but not external AutoExec, because it wouldn't work with forced programs, whereas the current form of AutoExec would work just fine.
Why do you say that a batch file would "never be the same thing" ?
Posted: Thu Feb 04, 2010 11:40 am
by lwc
So what I mean is something that runs before the sandbox even starts. Maybe "Pre Exec" would be a better a name for it. It does what it does before Sandboxie even has anything to do with the sandbox. Kind of like the difference between autoexec.bat and Programs=>Startup.
A batch file would mean:
1) An intimidating black screen.
2) It would have to be carried arround with the Sandboxie installation.
BTW, I've noticed Delete Command doesn't support any internal variables except "%sandbox%" (which, as you know, is not the original "%sandbox%"). It also seems to do various minor things like taking the read-only flag off the root folder and unhiding RegHive.LOG. I was thinking to use Toucan - a portable free utlity that mirrors only changes - and then rename the special "%sandbox%" back to its name. Alas, the aforementioened small changes probably mean it's not a good idea. It would have only worked if there was a "Post Exec" command that doesn't necessarily involve deletion.
Posted: Fri Feb 05, 2010 12:43 pm
by tzuk
lwc, I am not sure where you're going with this. To whom are you distributing (or are you planning to distribute) installations of Sandboxie, who would be intimidated by the black screen?