You can generally use this batch file to portabalize alot of things. Just change the variables to your needs (the set blah=blah lines)
[edit] Fixed to be automatically minimized [/edit]
@echo off
if NOT "%1" == "/Added" (
start /MIN "ShellWM Loader" %0 /Added
goto end
) else (
echo Loading...
)
:: Change these to your app's
:: applicationname is the name of the app
:: (no spaces please)
:: application is the file to run, "" if it has spaces
:: regkey1 is the branch created by the application
:: (Usually HKCU\Software\%applicationname%).
:: ::You can set regkeynumber to any number, just be sure temp.txt
rem echo reg export %regkey1% %applicationname%OldRegEnteries%%a.reg
%checkforerror%
)
echo Adding Registry enteries...
for /L %%b in (1,1,%regkeynumber%) DO (
reg import %applicationname%RegEnteries%%b.reg > temp.txt
%checkforerror%
)
echo Changing path...
for /F "" %%c IN ('Reg query %driveregkey%') DO (
reg add %driveregkey% /d %currentdrive%%%~pa /f > temp.txt
%checkforerror%
)
echo Starting %applicationname%.
echo ********************************
echo ****Do not close this window****
echo ********************************
echo If you do, your settings will not be saved,
echo or the registry enteries removed.
echo/
%application%
echo Exporting current settings...
for /L %%d IN (1,1,%regkeynumber%) DO (
rem set nothing=%%d
reg export %regkey1% %applicationname%RegEnteries%%d.reg > temp.txt
%checkforerror%
)
echo Replacing Original Enteries...
for /L %%e IN (1,1,%regkeynumber%) DO (
reg import %applicationname%OldRegEnteries%%e.reg > temp.txt
%checkforerror%
)
echo Done! (window will close automaticly)
ping 0.0.0.0 >nul
::pause
:end
exit