SBTool New Home ;-) Suggestions welcomed...

Utilities designed for use with Sandboxie
Post Reply
shawndion
Posts: 19
Joined: Fri Dec 11, 2009 1:41 pm

SBTool New Home ;-) Suggestions welcomed...

Post by shawndion » Mon Oct 10, 2011 4:45 am

As suggested by Tzuk...

SBTool now has a new home in the Contributed Utilities Section.

In the next message you will find a updated code of the SBTool it's a work in progress that should be fully operational this week (Without having to enter too much data) and because it's Dos Based and none of the commands are locked by windows you won't have any unknown errors.

The code that I am posting in the next message is in it's experimental phase the reason I am posting it before is so that should anyone have any ideas or suggestions on things to add I'll be able to fit it in the code.

Don't be shy I want this tool to complement Sandboxie and make all our lives easier...

Shawn

One more thing should anyone know of the best hosting place for me to upload the Batch File so that it doesn't get compromised please let me know
Thanks in advance.
Last edited by shawndion on Mon Oct 10, 2011 4:48 am, edited 1 time in total.

shawndion
Posts: 19
Joined: Fri Dec 11, 2009 1:41 pm

SBTool.bat Version .02b (Experimental Phase)

Post by shawndion » Mon Oct 10, 2011 4:46 am

:: +-------------------------------------------------------------------------------+
:: +SBTool.bat +
:: +Version .02b +
:: + +
:: + +
:: +-------------------------------------------------------------------------------+

:: +-------------------------------------------------------------------------------+
:: DEFAULT VARIABLE SETTINGS
:: +-------------------------------------------------------------------------------+
Set Sandbox="C:\Sandbox"
Set FirstBackup=D:\Sandbox_Backup
Set SecondBackup=D:\Sandbox_Modified
Set Container=DefaultBox
Set Original=Unknown
Set Modified=Unknown

@echo off
:: +-------------------------------------------------------------------------------+
:: MENU CHOICES
:: +-------------------------------------------------------------------------------+
:Menu
Set Choices=
Cls
Echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Echo = Sandboxie's All in One Mega Tool =
Echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Echo Please make sure your Sandboxie software is closed before Starting.
Echo What would you like to do?
Echo Type the corresponding letter to the choice you want and
Echo press Enter to continue.
Echo.
Echo. Current Sandbox : %Container% Original : %Original% Modified : %Modified%
Echo.
Echo.
Echo 0 - Settings (Backup, Restore)
Echo 1 - Backup Sandbox
Echo 2 - Different Backup (After running a program twice in Sandbox)
Echo 3 - Restore Sandbox
Echo 4 - Compare (You need to have B and D done for this to work)
Echo 5 - Registry Changes ((You need to have B and D done for this to work)
Echo 6 - Choose Sandbox Container
Echo 7 - Map Drives
Echo 8 - Quit Program
Echo.
SET /P Choices="Please Enter a Selection... "

if %Choices%==0 goto Locations
if %Choices%==1 goto Backup
if %Choices%==2 goto BackupDiff
if %Choices%==3 goto Restore
if %Choices%==4 goto Compare
if %Choices%==5 goto RegChanges
if %Choices%==6 goto SandboxSelection
if %Choices%==7 goto MapDrives
if %Choices%==8 goto End
goto Menu

:MapDrives

if NOT EXIST M:\ (Subst M: "%FirstBackup%\%USERNAME%\%Container%"&set Original="M:"&goto MapSecond)
if NOT EXIST N:\ (Subst N: "%FirstBackup%\%USERNAME%\%Container%"&set Original="N:"&goto MapSecond)
if NOT EXIST O:\ (Subst O: "%FirstBackup%\%USERNAME%\%Container%"&set Original="O:"&goto MapSecond)
if NOT EXIST P:\ (Subst P: "%FirstBackup%\%USERNAME%\%Container%"&set Original="P:"&goto MapSecond)
if NOT EXIST Q:\ (Subst Q: "%FirstBackup%\%USERNAME%\%Container%"&set Original="Q:"&goto MapSecond)
if NOT EXIST R:\ (Subst R: "%FirstBackup%\%USERNAME%\%Container%"&set Original="R:"&goto MapSecond)
if NOT EXIST S:\ (Subst S: "%FirstBackup%\%USERNAME%\%Container%"&set Original="S:"&goto MapSecond)
if NOT EXIST T:\ (Subst T: "%FirstBackup%\%USERNAME%\%Container%"&set Original="T:"&goto MapSecond)
:MapSecond
if NOT EXIST M:\ (Subst M: "%SecondBackup%\%USERNAME%\%Container%"&set Modified="M:"&goto Menu)
if NOT EXIST N:\ (Subst N: "%SecondBackup%\%USERNAME%\%Container%"&set Modified="N:"&goto Menu)
if NOT EXIST O:\ (Subst O: "%SecondBackup%\%USERNAME%\%Container%"&set Modified="O:"&goto Menu)
if NOT EXIST P:\ (Subst P: "%SecondBackup%\%USERNAME%\%Container%"&set Modified="P:"&goto Menu)
if NOT EXIST Q:\ (Subst Q: "%SecondBackup%\%USERNAME%\%Container%"&set Modified="Q:"&goto Menu)
if NOT EXIST R:\ (Subst R: "%SecondBackup%\%USERNAME%\%Container%"&set Modified="R:"&goto Menu)
if NOT EXIST S:\ (Subst S: "%SecondBackup%\%USERNAME%\%Container%"&set Modified="S:"&goto Menu)
if NOT EXIST T:\ (Subst T: "%SecondBackup%\%USERNAME%\%Container%"&set Modified="T:"&goto Menu)
goto Menu

:Locations
cls
Echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Echo = Sandboxie's All in One Mega Tool (Settings) =
Echo =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Set /P Sandbox="Enter main Sandbox Location ie: C:\sandbox? "
Set /P FirstBackup="Enter the path to your 1st Backup Folder ie: D:\Sandbox_Backup? "
Set /P SecondBackup="Enter the path to your 2nd Backup Folder ie: D:\Sandbox_Modified? "
Set /P Different="Enter the path where you want to store the differences ie: D:\Different? "
goto Menu

:Backup
cls
xcopy "%Sandbox%\%USERNAME%\%Container%\*.*" "%FirstBackup%\%USERNAME%\%Container%" /e /i /h /y
pause
goto End

:BackupDiff
cls
echo xcopy "%Sandbox%\%USERNAME%\%Container%\*.*" "%SecondBackup%\%USERNAME%\%Container%" /e /i /h /y
pause
goto End

:Restore
rd /s /q "%Sandbox%\%USERNAME%\%Container%\"
xcopy "%FirstBackup%\%USERNAME%\%Container%\*.*" "%Sandbox%\%USERNAME%\%Container%\" /e /i /h /y
pause
goto End

:Compare
REM ------------------------------------------------------------
REM Sandboxie Backup / Restore / What Has Changed Tool
REM ------------------------------------------------------------

rem Set Original=L:
rem Set Modified=M:
rem Set Different=C:\Different

dir /s /b /ad "%Modified%" > C:\ModFolder.txt
dir /a-d /s /b "%Original%" > C:\Original.txt
dir /a-d /s /b "%Modified%" > C:\Modified.txt

for /F "tokens=*" %%* in (c:\ModFolder.txt) do call :Foldersub %%*
for /F "tokens=*" %%* in (c:\Original.txt) do call :Originalsub %%*
for /F "tokens=*" %%* in (c:\Modified.txt) do call :Modifiedsub %%*
Goto End

REM ------------------------------------------------------------
:Foldersub
Set Folder=%*
Set Folder=%Folder:~3%
MD "%Different%\%Folder%"
goto :eof
REM ------------------------------------------------------------
:Originalsub
set One=%*
set Two=%*
set Two=%Modified%%Two:~2%
set Three=%Two:~3%
If EXIST "%Two%" fc /b "%One%" "%Two%" |find /i "no differences" >Nul
SET VALUE=%ERRORLEVEL%
IF %VALUE% == 1 echo f |xcopy "%Two%" "%Different%\%Three%" /H /Y /V >Nul
if NOT EXIST "%Two%" Echo The File located in %TWO% Has been deleted from Original Location. >> C:\DeletedList.txt
goto :eof
REM ------------------------------------------------------------
:Modifiedsub
set One=%*
set Two=%*
set Two=%Original%%Two:~2%
set Three=%Two:~3%
If EXIST "%Two%" fc /b "%One%" "%Two%" |find /i "no differences" >nul
SET VALUE=%ERRORLEVEL%
IF %VALUE% == 1 echo f |xcopy "%One%" "%Different%\%Three%" /H /Y /V >nul
IF NOT EXIST "%Two%" echo f |xcopy "%One%" "%Different%\%Three%" /H /Y /V >Nul
goto :eof
REM ------------------------------------------------------------
:RegChanges
REM EXPERIMENTAL STAGE

REG LOAD HKEY_USERS\Sandbox_Compaq_Owner_DefaultBox L:\RegHive
REG EXPORT HKEY_USERS\Sandbox_Compaq_Owner_DefaultBox Original.reg
REG UNLOAD HKEY_USERS\Sandbox_Compaq_Owner_DefaultBox
REG LOAD HKEY_USERS\Sandbox_Compaq_Owner_DefaultBox M:\RegHive
REG EXPORT HKEY_USERS\Sandbox_Compaq_Owner_DefaultBox Modified.reg
REG UNLOAD HKEY_USERS\Sandbox_Compaq_Owner_DefaultBox
regdiff modified.reg original.reg -d Changes.reg
goto :eof

:SandboxSelection
@echo off
set /a counter=0
find "[" c:\Windows\Sandboxie.ini >c:\report.txt
find /V " " C:\report.txt >c:\nospace.txt
find /V "_" C:\nospace.txt >c:\no_.txt
find "[" c:\no_.txt >c:\report.txt

for /F "tokens=*" %%* in (c:\Report.txt) do call :Originalsub %%*
goto :Schoice
:Originalsub
set str=%*
if "%str%"== "---------- C:\NO_.TXT" goto :eof
if "%str%"== "[GlobalSettings]" goto :eof
set /a counter+=1
set str=%str:~1,-1%
set Box%counter%=%str%
goto :eof


:Schoice
cls
Echo Sandbox Choices (Up to 20 Sandboxes)
Echo 01.%box1%
Echo 02.%box2%
Echo 03.%box3%
Echo 04.%box4%
Echo 05.%box5%
Echo 06.%box6%
Echo 07.%box7%
Echo 08.%box8%
Echo 09.%box9%
Echo 10.%box10%
Echo 11.%box11%
Echo 12.%box12%
Echo 13.%box13%
Echo 14.%box14%
Echo 15.%box15%
Echo 16.%box16%
Echo 17.%box17%
Echo 18.%box18%
Echo 19.%box19%
Echo 20.%box20%
Set /P SandboxChoice="Type in the Number of the Sanbox you wish to use?"
if %SandboxChoice%==1 Set Container=%box1%
if %SandboxChoice%==2 Set Container=%box2%
if %SandboxChoice%==3 Set Container=%box3%
if %SandboxChoice%==4 Set Container=%box4%
if %SandboxChoice%==5 Set Container=%box5%
if %SandboxChoice%==6 Set Container=%box6%
if %SandboxChoice%==7 Set Container=%box7%
if %SandboxChoice%==8 Set Container=%box8%
if %SandboxChoice%==9 Set Container=%box9%
if %SandboxChoice%==10 Set Container=%box10%
if %SandboxChoice%==11 Set Container=%box11%
if %SandboxChoice%==12 Set Container=%box12%
if %SandboxChoice%==13 Set Container=%box13%
if %SandboxChoice%==14 Set Container=%box14%
if %SandboxChoice%==15 Set Container=%box15%
if %SandboxChoice%==16 Set Container=%box16%
if %SandboxChoice%==17 Set Container=%box17%
if %SandboxChoice%==18 Set Container=%box18%
if %SandboxChoice%==19 Set Container=%box19%
if %SandboxChoice%==20 Set Container=%box20%
goto Menu

:End
Set Choices=
Subst /D %Original%
Subst /D %Modified%
cls
Echo Thank you for using SBTools have a nice day.
Pause

pjpj

Templates.ini

Post by pjpj » Sun Oct 16, 2011 10:13 am

I wonder if Templates.ini is modified often enough by users to be included in this?

I suppose most people would modify through the individual sandboxes rather than mess with this.

Guest10
Posts: 5124
Joined: Sun Apr 27, 2008 5:24 pm
Location: Ohio, USA

Re: Templates.ini

Post by Guest10 » Thu Jan 12, 2012 2:34 pm

pjpj wrote:I wonder if Templates.ini is modified often enough by users to be included in this?
I don't see any involvement here, with templates.ini, and that's how it should be.

Should
Set Sandbox="C:\Sandbox"
have those quotes around it?
Wouldn't that make "%Sandbox%" be evaluated as:
""C:\Sandbox""
Paul
Win 10 Home 64-bit (w/admin rights) - Zone Alarm Pro Firewall, MalwareBytes Premium A/V, Cyberfox, Thunderbird
Sandboxie user since March 2007

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest