@( ECHO OFF) :: Win-Traveller :: Copyright (C) 2007 Traveller Soft :: Traveller Soft - http://www.Win-Traveller.com :: Last updated Feb 26th 05:00 PM 2009 :: This application Script: Implements a customization process for Ms Windows 2K/XP& 2003 Interface& Users Profiles, :: installs/Un-installs necessary system drivers& files& Registry Keys for the Functionality of the Portable Programs. :: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License :: as published by the Free Software Foundation, either version 3 of the License, or any later version. :: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of :: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. :: You should have received a copy of the GNU General Public License along with this program. If not, see www.gnu.org/licenses : :: Code Section ( COLOR F0 & CLS) ( TITLE Win-Traveller v1.2) ( VERIFY OTHER 2>NUL) :: Check and Enable Extensions ? otherwise, exits. ( SETLOCAL ENABLEEXTENSIONS) ( IF NOT %ERRORLEVEL% EQU 0 CALL :WTF_Msg S..99E "System Error: Could not Enable Extensions.") :: Check if current OS is supported = Windows_NT? otherwise, exits. ( IF NOT "%OS%" == "Windows_NT" CALL :WTF_Msg S..99E "System Error: Current %OS% OS is not supported.") :: Check if Win-Traveller Root is available? otherwise, temporarily Park Win-Traveller Shell Folders to Local System Drive and exits. ( IF "%WTKey%" == "Park" IF NOT "%WTHome%" == "" IF NOT EXIST "%WTHome%" CALL :WTF_Park & GOTO :WTL_End) ::Check if Win-Traveller Root Folder Name is Supported = Drive:\Win-Traveller ? otherwise, exits. ( SET WTHome=%CMDCMDLINE:"=%) ( FOR /F "tokens=2* delims=/" %%n IN ("%WTHome%") DO SET WTHome=%%n>NUL 2>&1) ( SET WTHDrv=%WTHome:~2,2%) ( SET WTHome=%WTHome:~2,16%) ( IF NOT "%WTHDrv%\Win-Traveller" == "%WTHome%" CALL :WTF_Msg S..99E "Error: [%WTHome%] must be [%WTHDrv%\Win-Traveller]") ::Check if Chosen Win-Traveller Root Folder is Accessible = Read/Write ? otherwise, exits. ( SET WT_TmpFileHome=%WTHome%\WT-Home~1~2~3~) ( DEL %WT_TmpFileHome%>NUL 2>&1) ( CD >%WT_TmpFileHome% 2>nul) ( IF NOT EXIST %WT_TmpFileHome% CALL :WTF_Msg S..99E "Error: I Have no Access to this Drive. Drive is Read only!") ::Check if Accessible rights = Administrative ? otherwise, exits. ( DEL %WT_TmpFileHome%>NUL 2>&1) ( SET WT_RegKey=HKLM\Software\t~m~p~1~2~3) ( REG DELETE "%WT_RegKey%" /F>NUL 2>&1) ( REG ADD "%WT_RegKey%" /ve>NUL 2>&1||CALL :WTF_Msg S..99E "Error: Administrative rights are needed!") ( REG DELETE "%WT_RegKey%" /F>NUL 2>&1) ::Check if there is Enough free space on Selected Drive to host Win-Traveller = 5GB or more ? otherwise, exits. ( FOR /F "tokens=1,2,3* delims= " %%A IN ('DIR %WTHDrv% /AD') DO SET WT_FS=%%C>NUL 2>&1) ( SET /A WT_FS="%WT_FS:~,-12%") ( IF %WT_FS% LEQ 5 CALL :WTF_Msg S..99E "Error: Need 5GB or more to host Win-Traveller on selected Drive!") :: Resets Variables and Parameters starting with WT_ to NUL. ( SET WT_Cmd=SET) ( SET WT_>NUL 2>&1 && FOR /F "delims==" %%n IN ('%WT_Cmd% WT_') DO SET %%n=>NUL 2>&1) :: Sets Switches to Defaults. :: Log to File. Defaults=0 Disabled. ( SET /A WTLog=0) :: Debug to File. Defaults=0 Disabled. ( SET /A WTDeb=0) :: De/Activate local Machine by force. Defaults=0 Disabled. ( SET /A WTLoM=0) :: Sets Compression level switch. Defaults=9, range 0 to 9. ( SET /A WTFrz=9) :: Skip Time Waiting. Defaults=0 Disabled. ( SET /A WTSkT=0) :: Pass Win-Traveller Command String to Parameters and Switches. ( SET WTKey=%1) ( FOR /D %%A IN (%1 %2 %3 %4 %5) DO CALL :WTF_CmdStr %%A) :: Sets other Parameters and Switches. ( SET WT_Err=None) ( SET WT_Ver=v1.2) ( SET WT_Title=Win-Traveller) ( SET WT_Copyright=Copyright 2007 Traveller Soft) ( SET WT_Web=Traveller Soft - http://www.Win-Traveller.com) ( SET WT_RegKey=HKLM\Software\Win-Traveller %WT_Ver%) ( SET WT_RegCT=HKCU\Control Panel\Desktop) ( SET WT_DebFile=NUL) ( SET WT_LogFile=NUL) ( SET WT_SPass=wt!7z@ps#v$1) ( SET WT_SPckl=Win-Traveller.PkgList.txt) ( SET WT_SExpl=Win-Traveller.ExpList.txt) ( SET WT_OS="") ( SET WT_OSV=HKLM\Software\Microsoft\Windows NT\CurrentVersion) ( FOR /F "tokens=3" %%I IN ('REG QUERY "%WT_OSV%" /v "CurrentVersion"') DO SET WT_OS="%%I") ( Title %WT_Title% %WT_Ver%) ( IF "%WTKey%" == "" GOTO :WTL_Choices) ( CALL :WTS_Model%WTKey% 0 2>NUL) ( IF NOT "%WT_Model%" == "" GOTO :WTL_RunChoice) :WTL_Choices ( COLOR F0 & CLS & ECHO.) ( CALL :WTF_Msg S.. " %WT_Copyright%") ( CALL :WTF_Msg S.....L " %WT_Web%") ( CALL :WTF_Msg S.....L " Thanks %USERNAME% for Using Win-Traveller.") ( CALL :WTS_ModelB 1) ( SET /P WT_Key= Enter a choice or Q to quit, then please press enter:) ( IF /I "%WT_Key%" == "Q" GOTO :WTL_End) ( CALL :WTS_Model%WT_Key% 0 2>NUL) ( IF NOT "%WT_Model%" == "" GOTO :WTL_RunChoice) ( COLOR F8 & CALL :WTF_Msg S..50 " Invalid choice ...") ( GOTO :WTL_Choices) :WTL_RunChoice ( COLOR F%WT_Model:~-1,1%) ( SET WT_ModelDescr=%WT_Model:~18,-2%) ( SET WT_Model=%WT_Model:~,14%) ( SET WT_Model=%WT_Model: =%) ( CALL :WTF_Msg S.. " Starting %WT_Model%...") ( IF %WT_Model% == WinDebug CALL :WTF_WinDebug & GOTO :WTL_Choices) ( IF %WT_Model% == WinLog CALL :WTF_WinLog & GOTO :WTL_Choices) ( IF %WT_Model% == WinFreeze CALL :WTF_WinFreeze & GOTO :WTL_Choices) ( IF %WT_Model% == WinMachine CALL :WTF_WinMachine & GOTO :WTL_Choices) ( TITLE %WT_Title% %WT_Ver% %WT_Model%) ( CLS & CALL :WTF_Msg S.. "%WT_Title% %WT_Ver% %WT_Model%" "%WT_Copyright%") ( CALL :WTF_Msg S.....L "%WT_Web%" "%WT_ModelDescr%") ( CALL :WTF_Set_ParseLMachine) ( IF NOT %WT_Err% == None IF NOT "%WTKey%" == "" GOTO :WTL_Finished) ( IF NOT %WT_Err% == None GOTO :WTL_Start) ( CALL :WTF_Set_Output) ( CALL :WTF_Parameters) ( CALL :WTF_Prompt) ( CALL :WTF_Start) ( IF %WT_Model% == WinIconics ( CALL :WTF_Iconics & GOTO :WTL_Finished)) ( IF %WT_Model% == WinpacKage ( CALL :WTF_pacKage & GOTO :WTL_Finished)) ( IF %WT_Err% == None CALL :WTF_eXpand) ( IF %WT_Err% == None CALL :WTF_Iconics) ( IF %WT_Err% == None CALL :WTF_liNks) ( IF %WT_Err% == None CALL :WTF_Profiler) ( IF %WT_Err% == None CALL :WTF_SetUserTempEnvVar) ( IF %WT_Err% == None CALL :WTF_SetWTHomeEnvVar) ( IF %WT_Err% == None CALL :WTF_ShellFolders) ( IF %WT_Err% == None CALL :WTF_ParsingCU) ( IF %WT_Err% == None CALL :WTF_ParsingLM) ( IF %WT_Err% == None CALL :WTF_Registry) ( IF %WT_Err% == None CALL :WTF_Themes) ( IF %WT_Err% == None CALL :WTF_ShellRestart) ( SET WT_Msg=Logoff) ( IF %WT_ParseLMachine% == 1 SET WT_Msg=Restart Windows) ( IF %WT_Err% == None CALL :WTF_Msg S.. "%USERNAME%, please %WT_Msg% for settings to take effect.") :WTL_Finished ( IF %WT_Err% == Root CALL :WTF_Msg S..99 "%WT_Err% Error, Couldn't Update %USERNAME% Home Folder") ( IF %WT_Err% == WTRoot CALL :WTF_Msg S..99 "%WT_Err% Error, %WTHome% not found") ( IF %WT_Err% == Fatal CALL :WTF_Msg S..99 "%WT_Err% Error, Check Log/Debug Files for errors.") ( SET WT_Time=%Time%) ( SET /A WT_FTime="%WT_Time:~,2% * 360000 + %WT_Time:~3,2% * 6000 + %WT_Time:~6,2% * 100 + %WT_Time:~9,2%" 2>NUL) ( SET /A WT_TTime="%WT_FTime%-%WT_STime%") ( CALL :WTF_Msg SLD "Finished: %Date% at %WT_Time% in %WT_TTime% MSec") ( IF %WT_Err% == None CALL :WTF_Msg S..99 "ResStarting Shortly...") ( IF EXIST %WT_RegFile% DEL %WT_RegFile% /F>>%WT_LogFile% 2>&1) ( IF EXIST %WT_TmpFile% DEL %WT_TmpFile% /F>>%WT_LogFile% 2>&1) ( SET WT_Editer=%WTHome%\!Freeware\Development\Editors\Notepadpp!\notepad++.exe) ( IF NOT EXIST %WT_Editer% SET WT_Editer=%WinDir%\NOTEPAD.EXE) ( IF %WTLog% == 1 IF EXIST %WT_LogFile% START /B %WT_Editer% %WT_LogFile%) ( IF %WTDeb% == 1 IF EXIST %WT_DebFile% START /B %WT_Editer% %WT_DebFile%) ( IF EXIST %WT_IcoFile% START /B %WT_Editer% %WT_IcoFile%) ( GOTO :WTL_End) : S t a r t o f W T _ F u n c t i o n s _ L i b r a r y : Menu Subs :WTS_ModelB ( SET WT_Model=WinBatcher B - Batch user profile and activate LM set by winmachine. 1) ( IF NOT %1 == 0 ( CALL :WTF_Msg S.....L " %WT_Model:~,-1%") ELSE ( GOTO :EOF)) :WTS_ModelH ( SET WT_Model=WinHooker H - unHook user profile and deactivate LM set by winmachine. 4) ( IF NOT %1 == 0 ( CALL :WTF_Msg S.....L " %WT_Model:~,-1%") ELSE ( GOTO :EOF)) :WTS_ModelK ( SET WT_Model=WinpacKage K - pacKage programs listed: %WT_SPckl% C) ( IF NOT %1 == 0 ( CALL :WTF_Msg S.....L " %WT_Model:~,-1%") ELSE ( GOTO :EOF)) :WTS_ModelI ( SET WT_Model=WinIconics I - re-wrIte Win-Traveller's folders structure and icons. 3) ( IF NOT %1 == 0 ( CALL :WTF_Msg S.....L " %WT_Model:~,-1%") ELSE ( GOTO :EOF)) :WTS_ModelF ( SET WT_Model=WinFreeze F - compression level switch [current is : %WTFrz%] 8) ( IF NOT %1 == 0 ( CALL :WTF_Msg S.. " %WT_Model:~,-1%") ELSE ( GOTO :EOF)) :WTS_ModelM ( SET WT_Model=WinMachine M - de/activate local Machine by force [current is : %WTLoM%]. 8) ( IF NOT %1 == 0 ( CALL :WTF_Msg S.. " %WT_Model:~,-1%") ELSE ( GOTO :EOF)) :WTS_ModelD ( SET WT_Model=WinDebug D - switch Debug mode on/off [current is : %WTDeb%]. 8) ( IF NOT %1 == 0 ( CALL :WTF_Msg S.. " %WT_Model:~,-1%") ELSE ( GOTO :EOF)) :WTS_ModelL ( SET WT_Model=WinLog L - switch Log mode on/off [current is : %WTLog%]. 8) ( IF NOT %1 == 0 ( CALL :WTF_Msg S.....L " %WT_Model:~,-1%") ELSE ( GOTO :EOF)) :WTS_ModelLast ( SET WT_Model=) ( GOTO :EOF) : Sets Command Strings to override default switches :WTF_CmdStr :: Pass Win-Traveller Command String to Sets Switches ( IF "%1" == "T" SET /A WTSkT=1) ( IF "%1" == "M" SET /A WTLoM=1) ( IF "%1" == "L" SET /A WTLog=1) ( IF "%1" == "D" SET /A WTDeb=1) ( GOTO :EOF) : Sets WinDebug and WinLog :WTF_WinDebug ( SET /A WTDeb="%WTDeb%+1&1") ( GOTO :EOF) :WTF_WinLog ( SET /A WTLog="%WTLog%+1&1") ( GOTO :EOF) :WTF_WinFreeze ( SET /A WTFrz=%WTFrz%+1) ( IF "%WTFrz%"=="10" SET /A WTFrz=1) ( GOTO :EOF) :WTF_WinMachine ( SET /A WTLoM="%WTLoM%+1&1") ( GOTO :EOF) : Sets ParseLMachine and User Installed :WTF_Set_ParseLMachine ( SET WT_ParseLMachine=0) ( SET WT_UserHomeInstalled=1) ( REG QUERY "%WT_RegKey%\Users" /v "%USERNAME%">NUL 2>&1||SET WT_UserHomeInstalled=0) ( REG QUERY "%WT_RegKey%">NUL 2>&1||SET WT_ParseLMachine=1) ( IF %WT_Model% == WinpacKage ( ( IF EXIST "%WTHome%\Setup\%WT_SPckl%" GOTO :EOF) ( CALL :WTF_Msg S..99 "System Error, %WT_SPckl% Do not exists! Please build first, Process ended.") ( SET WT_Err=User) ( GOTO :EOF) )) ( IF %WT_Model% == WinZip ( ( IF %WT_ParseLMachine% == 1 GOTO :EOF) ( IF %WT_UserHomeInstalled% == 0 GOTO :EOF) ( CALL :WTF_Msg S..99 "System Error, Win-Traveller is Active on localmachine, Process ended.") ( SET WT_Err=User) ( GOTO :EOF) )) ( IF %WT_Model% == WineXpand GOTO :EOF) ( IF %WT_Model% == WinIconics GOTO :EOF) ( IF %WT_Model% == WinFreeze GOTO :EOF) ( IF %WT_Model% == WinBatcher ( ( IF %WT_ParseLMachine% == 1 GOTO :EOF) ( IF %WTLoM% == 1 GOTO :EOF) ( REG QUERY "%WT_RegKey%" /v WTHome >NUL 2>&1 ) &&( FOR /F "tokens=5*" %%I IN ('REG QUERY "%WT_RegKey%" /v WTHome') DO CALL :WTS_Set_ParseLMachine_WTHome "%%I" ) ||( SET WT_ParseLMachine=1) ( GOTO :EOF) )) ( IF %WT_Model% == WinHooker ( ( IF %WTLoM% == 1 GOTO :EOF) ( IF %WT_UserHomeInstalled% == 1 ( ( FOR /F "tokens=*" %%I IN ('REG QUERY "%WT_RegKey%\Users" /s') DO CALL :WTS_Set_ParseLMachine) ) ELSE ( ( CALL :WTF_Msg S..99 "User Error, current user %USERNAME% is not Batched, Process ended.") ( SET WT_Err=User) )) ( GOTO :EOF) )) ( GOTO :EOF) :WTS_Set_ParseLMachine_Par ( SET WT_ParseLMachine=%1) ( GOTO :EOF) :WTS_Set_ParseLMachine ( SET /A WT_UserHomesCount="%WT_UserHomesCount%+1") ( SET WT_ParseLMachine=0) ( IF /I %WT_UserHomesCount% EQU 4 SET WT_ParseLMachine=1) ( GOTO :EOF) :WTS_Set_ParseLMachine_WTHome ( IF NOT "%WTHome%" == %1 SET WT_ParseLMachine=1) ( GOTO :EOF) : Output Files to RLst = Registry, TLst = Temp, ILst = Icons, LLst = Log, DLst = Debug :WTF_Set_Output ( SET WT_TmpFile="%WTHome%\WT_TmpFile-%WT_Model%-%USERNAME%.txt") ( SET WT_TmpFil0="%WTHome%\WT_TmpFil0-%WT_Model%-%USERNAME%.txt") ( SET WT_IcoFile="%WTHome%\WT_IcoFile-%WT_Model%-%USERNAME%.cmd") ( SET WT_RegFile="%WTHome%\WT_RegFile-%WT_Model%-%USERNAME%.reg") ( SET WT_DebFile=NUL) ( IF %WTDeb% == 1 SET WT_DebFile="%WTHome%\WT_DebFile-%WT_Model%-%USERNAME%.cmd") ( SET WT_LogFile=NUL) ( IF %WTLog% == 1 SET WT_LogFile="%WTHome%\WT_LogFile-%WT_Model%-%USERNAME%.cmd") ( GOTO :EOF) : Input: [Screen, Log, Debug] Waits-seconds, Message :WTF_Msg ( IF NOT "%~2" == "" CALL :WTS_MsgPrint %1 %2) ( IF NOT "%~3" == "" CALL :WTS_MsgPrint %1 %3) ( IF NOT "%~4" == "" CALL :WTS_MsgPrint %1 %4) ( IF NOT "%~5" == "" CALL :WTS_MsgPrint %1 %5) ( IF NOT "%~6" == "" CALL :WTS_MsgPrint %1 %6) ( GOTO :EOF) :WTS_MsgPrint ( SET WT_Output=%1) ( IF "%WT_Output:~,1%" == "S" ( ECHO %~2 %~3 %~4 %~5) >&2 & IF "%WT_Output:~6,1%" == "L" ECHO.>&2) ( IF "%WT_Output:~1,1%" == "L" IF %WTLog% == 1 ( ECHO %~2) >>%WT_LogFile% & IF "%WT_Output:~6,1%" == "L" ECHO.>>%WT_LogFile%) ( IF "%WT_Output:~2,1%" == "D" IF %WTDeb% == 1 ( ECHO %~2) >>%WT_DebFile% & IF "%WT_Output:~6,1%" == "L" ECHO.>>%WT_DebFile%) ( IF NOT "%WT_Output:~3,2%" == "" CALL :WTF_Wait %WT_Output:~3,2%) ( IF "%WT_Output:~5,1%" == "E" GOTO :WTL_End) ( GOTO :EOF) : Waits For 1/100 Seconds :WTF_Wait ( IF "%WTSkT%" == "1" GOTO :EOF) ( SET WT_Now=%Time% 2>NUL) ( IF "%1" == "" SET /A WT_Wait="10") ( IF NOT "%1" == "" SET /A WT_Wait="10 * %1") ( SET /A WT_Start="%WT_Wait% + %WT_Now:~,2% * 360000 + %WT_Now:~3,2% * 6000 + %WT_Now:~6,2% * 100 + %WT_Now:~9,2%" 2>NUL) :WTL_Wait_Loop ( SET WT_Now=%Time% 2>NUL) ( SET /A WT_End="%WT_Now:~,2% * 360000 + %WT_Now:~3,2% * 6000 + %WT_Now:~6,2% * 100 + %WT_Now:~9,2%" 2>NUL) ( ECHO>NUL) ( IF %WT_End% LEQ %WT_Start% GOTO :WTL_Wait_Loop) ( SET WT_Now=) ( SET WT_Wait=) ( SET WT_Start=) ( SET WT_End=) ( GOTO :EOF) : Determine and sets Local Parameters and Switches :WTF_Parameters ( SET WT_SFSys=%WTHome%\Setup\System) ( SET WT_SFUsr=%WT_SFSys%\$Users template$) ( SET WT_SFDrv=%WT_SFSys%\Drivers) ( SET WT_SFReg=%WT_SFSys%\Registry) ( SET WT_SFCal=%WT_SFSys%\ToCall) ( SET WT_SFPar=%WT_SFSys%\ToParse) ( SET WT_SFLib=%WT_SFSys%\ToRegister) ( IF %WTLoM% == 1 SET WT_ParseLMachine=1) ( SET WT_UserHome="%WTHome%\Users\%USERNAME%") ( IF %WT_Model% == WinHooker SET WT_UserHome="%USERPROFILE%") ( GOTO :EOF) : Prompt the current-user to Continue, Displaying Win-Traveller Parameters Summary :WTF_Prompt ( CALL :WTF_Msg S.. "Win-Traveller Home Root On Host: %WTHome%") ( SET WT_Msg=Not) ( IF %WT_UserHomeInstalled% == 1 SET WT_Msg=) ( CALL :WTF_Msg S.. "CurrentUser: %USERNAME% is %WT_Msg% Batched.") ( IF %WT_Model% == WinBatcher IF %WT_ParseLMachine% == 1 CALL :WTF_Msg S.. "Win-Traveller will Activate LocalMachine") ( IF %WT_Model% == WinHooker IF %WT_ParseLMachine% == 1 CALL :WTF_Msg S.. "Win-Traveller will Deactivate LocalMachine") ( CALL :WTF_Msg S.....L "To Stop/End, %USERNAME% Please Press Cntr+C, Starting Shortly...") ( GOTO :EOF) : Starts Model :WTF_Start ( IF %WTLog% == 1 >%WT_LogFile% ECHO %0 %*) ( IF %WTDeb% == 1 >%WT_DebFile% ECHO %0 %*) ( CALL :WTF_Msg .L. "%WT_Title% %WT_Ver% %WT_Model%" "%WT_Copyright%" "%WT_Web%") ( SET WT_Time=%Time%) ( SET /A WT_STime="%WT_Time:~,2% * 360000 + %WT_Time:~3,2% * 6000 + %WT_Time:~6,2% * 100 + %WT_Time:~9,2%" 2>NUL) ( CALL :WTF_Msg SLD "Started: %Date% at %WT_Time%") ( FOR /F "usebackq delims=*" %%I IN (`VER`) DO CALL :WTF_Msg .L. "Current Operating System: %%I") ( CALL :WTF_Msg .L. "Determined Parameters and Options:") ( IF %WTLog% == 1 SET WT_>>%WT_LogFile%) ( GOTO :EOF) : Create/Update current user Root Folder Using Users template :WTF_Profiler ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( IF %WT_Model% == WinHooker GOTO :EOF) ( IF EXIST "%WTHome%\Users\%USERNAME%\Favorites\Win-Traveller" ( ( RMDIR "%WTHome%\Users\%USERNAME%\Favorites\Win-Traveller\!Freeware" /S /Q >NUL 2>&1) ( RMDIR "%WTHome%\Users\%USERNAME%\Favorites\Win-Traveller\!Programs" /S /Q >NUL 2>&1) ( RMDIR "%WTHome%\Users\%USERNAME%\Favorites\Win-Traveller\!Shareware" /S /Q >NUL 2>&1) ( CALL :WTF_Msg SL. "Removing Old Links from User's WT Profile ...") )) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: AppData ...") ( SET WT_Src="%USERPROFILE%\Application Data") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Application Data\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: Cookies ...") ( SET WT_Src="%USERPROFILE%\Cookies") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Cookies\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: Desktop ...") ( SET WT_Src="%USERPROFILE%\Desktop") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Desktop\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: Favorites ...") ( SET WT_Src="%USERPROFILE%\Favorites") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Favorites\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: NetHood ...") ( SET WT_Src="%USERPROFILE%\NetHood") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\NetHood\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: %USERNAME%'s Documents ...") ( SET WT_Src="%USERPROFILE%\My Documents") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Documents\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: PrintHood ...") ( SET WT_Src="%USERPROFILE%\PrintHood") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\PrintHood\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: Recent ...") ( SET WT_Src="%USERPROFILE%\Recent") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Recent\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: SendTo ...") ( SET WT_Src="%USERPROFILE%\SendTo") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\SendTo\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: Start Menu ...") ( SET WT_Src="%USERPROFILE%\Start Menu") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Start Menu\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: Templates ...") ( SET WT_Src="%USERPROFILE%\Templates") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Templates\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ::Programs Start Menu\Programs Done before w/Start Menu copy ::Startup Start Menu\Programs\Startup Done before w/Start Menu copy ( CALL :WTF_Msg SL. "Copying/Updating User's WT Profile: Local Settings ...") ( SET WT_Src="%USERPROFILE%\Local Settings") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\Local Settings\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ::Local AppData Local Settings\Application Data Done before w/Local Settings ::Cache Local Settings\Temporary Internet Files Done before w/Local Settings ::History Local Settings\History Done before w/Local Settings ::My Pictures My Documents\My Pictures Done before w/My Documents ::My Music My Documents\My Music Done before w/My Documents ::My Video My Documents\My Video Done before w/My Documents ::CD Burning Application Data\Microsoft\CD Burning Done before w/Local Settings ::Administrative Tools Start Menu\Programs\Administrative Tools Done before w/Start Menu copy ( CALL :WTF_Msg SL. "Creating/Updating current-user's: %USERNAME% WT Home Profile ...") ( SET WT_Src="%WT_SFUsr%") ( SET WT_Dst="%WTHome%\Users\%USERNAME%\") ( XCOPY %WT_Src% %WT_Dst% /F /H /K /Y /C /R /I /E /S >>%WT_LogFile% 2>&1) ( SET WT_Src=) ( SET WT_Dst=) ( GOTO :EOF) : Assign Win-Traveller Root Path for current-user :WTF_SetWTHomeEnvVar ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( SET WT_Msg=WT's Home Root Path for current-user: %USERNAME%) ( SET WT_TRK=HKCU\Environment) ( IF %WT_Model% == WinBatcher ( ( CALL :WTF_Msg SL. "Assign %WT_Msg%" & CALL :WTF_Msg .L. "to %WTHome%") (>>%WT_LogFile% REG ADD %WT_TRK% /v "WTHome" /t REG_EXPAND_SZ /d "%WTHome%" /F 2>&1||SET WT_Err=Fatal) )) ( IF %WT_Model% == WinHooker ( ( CALL :WTF_Msg SL. "Remove %WT_Msg%") ( REG QUERY %WT_TRK% /v "WTHome" >NUL 2>&1 ) &&( REG DELETE %WT_TRK% /v "WTHome" /F >>%WT_LogFile% 2>&1 ) ||( CALL :WTF_Msg .L. "Not Found, Skipped") )) ( SET WT_Msg=) ( SET WT_TRK=) ( GOTO :EOF) : Assign Win-Traveller Temp Path for current-user :WTF_SetUserTempEnvVar ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( SET WT_Msg=WT's Temp Path for current-user: %USERNAME%) ( SET WT_TRK=HKCU\Environment) ( IF %WT_Model% == WinBatcher ( ( CALL :WTF_Msg SL. "Assign %WT_Msg%" & CALL :WTF_Msg .L. "to %WT_UserHome:~1,-1%\Local Settings\Temp") (>>%WT_LogFile% REG ADD %WT_TRK% /v "TEMP" /t REG_EXPAND_SZ /d "%WT_UserHome:~1,-1%\Local Settings\Temp" /F 2>&1) (>>%WT_LogFile% REG ADD %WT_TRK% /v "TMP" /t REG_EXPAND_SZ /d "%WT_UserHome:~1,-1%\Local Settings\Temp" /F 2>&1) )) ( IF %WT_Model% == WinHooker ( ( CALL :WTF_Msg SL. "Remove %WT_Msg%") (>>%WT_LogFile% REG ADD %WT_TRK% /v "TEMP" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Local Settings\Temp" /F 2>&1) (>>%WT_LogFile% REG ADD %WT_TRK% /v "TMP" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Local Settings\Temp" /F 2>&1) )) ( SET WT_Msg=) ( SET WT_TRK=) ( GOTO :EOF) : Assign Win-Traveller Themes for current-user :WTF_Themes ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( IF %WT_Model% == WinHooker GOTO :EOF) ( IF NOT %WT_OS% == "6.0" CALL :WTS_ThemesSet "%WTHome%\!Freeware\Accessories\Themes\Royale!\Royale Blue.theme") ( IF %WT_OS% == "6.0" CALL :WTS_ThemesSet "%WTHome%\!Freeware\Accessories\Themes\Luna!\XP Metal.theme") ( GOTO :EOF) :WTS_ThemesSet ( IF NOT EXIST %1 GOTO :EOF) ( CALL :WTF_Msg SL. "Applying theme for Current user: %USERNAME%") ( CALL :WTF_Msg SL. " %~1 ...") ( START /B rundll32 shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /file:%1>NUL 2>&1) ( GOTO :EOF) : Assign currentuser Shell Folders :WTF_ShellFolders ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( CALL :WTF_Msg SL. "Assigning WT's Shell Folders for current-user: %USERNAME% ...") ( SET WT_TRK_U="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders") ( SET WT_TRK_S="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders") ( SET WT_My=) ( IF %WT_Model% == WinHooker SET WT_My=\My) ( SET WT_My_Documents=) ( IF %WT_Model% == WinHooker SET WT_My_Documents=\My Documents) ::User Shell Folders \AppData=%USERPROFILE%\Application Data ::Shell Folders \AppData=C:\Documents and Settings\Y\Application Data ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "AppData" "%WT_UserHome:~1,-1%\Application Data") ::User Shell Folders \Cookies=%USERPROFILE%\Cookies ::Shell Folders \Cookies=C:\Documents and Settings\Y\Cookies ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Cookies" "%WT_UserHome:~1,-1%\Cookies") ::User Shell Folders \Desktop=%USERPROFILE%\Desktop ::Shell Folders \Desktop=C:\Documents and Settings\Y\Desktop ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Desktop" "%WT_UserHome:~1,-1%\Desktop") ::User Shell Folders \Favorites=%USERPROFILE%\Favorites ::Shell Folders \Favorites=C:\Documents and Settings\Y\Favorites ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Favorites" "%WT_UserHome:~1,-1%\Favorites") ::User Shell Folders \NetHood=%USERPROFILE%\NetHood ::Shell Folders \NetHood=C:\Documents and Settings\Y\NetHood ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "NetHood" "%WT_UserHome:~1,-1%\NetHood") ::User Shell Folders \Personal=%USERPROFILE%\My Documents ::Shell Folders \Personal=C:\Documents and Settings\Y\My Documents ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Personal" "%WT_UserHome:~1,-1%%WT_My_Documents%") ::User Shell Folders \PrintHood=%USERPROFILE%\PrintHood ::Shell Folders \PrintHood=C:\Documents and Settings\Y\PrintHood ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "PrintHood" "%WT_UserHome:~1,-1%\PrintHood") ::User Shell Folders \Recent=%USERPROFILE%\Recent ::Shell Folders \Recent=C:\Documents and Settings\Y\Recent ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Recent" "%WT_UserHome:~1,-1%\Recent") ::User Shell Folders \SendTo=%USERPROFILE%\SendTo ::Shell Folders \SendTo=C:\Documents and Settings\Y\SendTo ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "SendTo" "%WT_UserHome:~1,-1%\SendTo") ::User Shell Folders \Start Menu=%USERPROFILE%\Start Menu ::Shell Folders \Start Menu=C:\Documents and Settings\Y\Start Menu ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Start Menu" "%WT_UserHome:~1,-1%\Start Menu") ::User Shell Folders \Templates=%USERPROFILE%\Templates ::Shell Folders \Templates=C:\Documents and Settings\Y\Templates ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Templates" "%WT_UserHome:~1,-1%\Templates") ::User Shell Folders \Programs=%USERPROFILE%\Start Menu\Programs ::Shell Folders \Programs=C:\Documents and Settings\Y\Start Menu\Programs ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Programs" "%WT_UserHome:~1,-1%\Start Menu\Programs") ::User Shell Folders \Startup=%USERPROFILE%\Start Menu\Programs\Startup ::Shell Folders \Startup=C:\Documents and Settings\Y\Start Menu\Programs\Startup ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Startup" "%WT_UserHome:~1,-1%\Start Menu\Programs\Startup") ::User Shell Folders \Local Settings=%USERPROFILE%\Local Settings ::Shell Folders \Local Settings=C:\Documents and Settings\Y\Local Settings ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Local Settings" "%WT_UserHome:~1,-1%\Local Settings") ::User Shell Folders \Local AppData=%USERPROFILE%\Local Settings\Application Data ::Shell Folders \Local AppData=C:\Documents and Settings\Y\Local Settings\Application Data ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Local AppData" "%WT_UserHome:~1,-1%\Local Settings\Application Data") ::User Shell Folders \Cache=%USERPROFILE%\Local Settings\Temporary Internet Files ::Shell Folders \Cache=C:\Documents and Settings\Y\Local Settings\Temporary Internet Files ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Cache" "%WT_UserHome:~1,-1%\Local Settings\Temporary Internet Files") ::User Shell Folders \History=%USERPROFILE%\Local Settings\History ::Shell Folders \History=C:\Documents and Settings\Y\Local Settings\History ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "History" "%WT_UserHome:~1,-1%\Local Settings\History") ::User Shell Folders \My Pictures=%USERPROFILE%\My Documents\My Pictures ::Shell Folders \My Pictures=C:\Documents and Settings\Y\My Documents\My Pictures ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "My Pictures" "%WT_UserHome:~1,-1%%WT_My_Documents%%WT_My%\Pictures") ::User Shell Folders \My Music=%USERPROFILE%\My Documents\My Music ::Shell Folders \My Music=C:\Documents and Settings\Y\My Documents\My Music ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "My Music" "%WT_UserHome:~1,-1%%WT_My_Documents%%WT_My%\Music") ::User Shell Folders \CD Burning=%USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning ::Shell Folders \CD Burning=C:\Documents and Settings\Y\Local Settings\\Application Data\Microsoft\CD Burning ( IF %WT_Err% == None ( ( CALL :WTS_ShellFoldersSet "CD Burning" "%WT_UserHome:~1,-1%\Local Settings\Application Data\Microsoft\CD Burning") )) ::User Shell Folders \My Video=%USERPROFILE%\My Documents\My Video ::Shell Folders \My Video=C:\Documents and Settings\Y\My Documents\My Video ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "My Video" "%WT_UserHome:~1,-1%%WT_My_Documents%%WT_My%\Videos") ::User Shell Folders \Administrative Tools=%USERPROFILE%\Start Menu\Programs\Administrative Tools ::Shell Folders \Administrative Tools=C:\Documents and Settings\Y\Start Menu\Programs\Administrative Tools ( IF %WT_Err% == None ( ( CALL :WTS_ShellFoldersSet "Administrative Tools" "%WT_UserHome:~1,-1%\Start Menu\Programs\Administrative Tools") )) ::User Shell Folders \Templates=%USERPROFILE%\Templates ::Shell Folders \Templates=C:\Users\Y\Templates ( IF %WT_Err% == None CALL :WTS_ShellFoldersSet "Templates" "%WT_UserHome:~1,-1%\Templates") ( SET WT_My=) ( SET WT_My_Documents=) ( SET WT_TRK_U=) ( SET WT_TRK_S=) ( GOTO :EOF) :WTS_ShellFoldersSet ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( REG ADD %WT_TRK_S% /v %1 /d %2 /F >>%WT_LogFile% 2>&1)||(( SET WT_Err=Fatal)&( GOTO :EOF)) ( CALL :WTF_Msg .L. "Shell Folder %~1 to %~2") ( REG ADD %WT_TRK_U% /v %1 /t REG_EXPAND_SZ /d %2 /F >>%WT_LogFile% 2>&1)||(( SET WT_Err=Fatal)&( GOTO :EOF)) ( CALL :WTF_Msg .L. "User's Shell Folder %~1 to %~2") ( GOTO :EOF) : Parsing current-user options :WTF_ParsingCU ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( CALL :WTF_Msg SL. "Processing WT System Folders;") ( CALL :WTF_Msg SL. " Activateing features and options for current-user: %USERNAME% ...") ( IF %WT_Model% == WinBatcher CALL :WTS_PCU "%WT_SFReg%\[*]HKCU+?.reg") ( IF %WT_Model% == WinHooker CALL :WTS_PCU "%WT_SFReg%\[*]HKCU-?.reg") ( GOTO :EOF) ::Parse current-user, Importing Registry Keys :WTS_PCU ( DIR %1 /-B /-S /A-D-S >%WT_TmpFile% 2>NUL ) &&( CALL :WTF_Msg .L. "Processing WT Registry Files: %~1" ) &&( FOR /F "tokens=1,2,3* usebackq delims=[]" %%I IN (%WT_TmpFile%) DO CALL :WTS_CUDo "%%I" "%%J" "%%K") ( GOTO :EOF) :WTS_CUDo ( SET WT_Exist=%~2) ( SET WT_Exist=%WT_Exist:+=\%) ( IF "%WT_Exist:~-1%" == "!" IF NOT EXIST "%WTHome%\%WT_Exist%" ( ( CALL :WTF_Msg SL. "Skipped Import, Couldn't Find Parent Folder: %WT_Exist%") ( GOTO :EOF) )) ( CALL :WTF_Msg .L. "Importing Registry File: %~1[%~2]%~3") ( TYPE "%~1[%~2]%~3" >%WT_RegFile% 2>NUL) ( TYPE %WT_RegFile% >>%WT_LogFile% 2>NUL) ( SET WT_Convert=%~3) ( IF "%WT_Convert:~5,1%" == "$" IF NOT "%WTHDrv%" == "D:" ( ("%WT_SFSys%\reptxt32.exe" /I %WT_RegFile% D:\ %WTHDrv%\ >>%WT_LogFile% 2>&1) ( TYPE %WT_RegFile% >>%WT_LogFile% 2>NUL) )) ( REG IMPORT %WT_RegFile% >>%WT_LogFile% 2>&1) ( SET WT_Convert=) ( SET WT_Exist=) ( GOTO :EOF) : Parsing Win-Traveller System Files for localmachine :WTF_ParsingLM ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( IF NOT %WT_ParseLMachine% == 1 GOTO :EOF) ( CALL :WTF_Msg SL. "Processing WT System Folders;") ( CALL :WTF_Msg SL. " Activateing features and options for localmachine ...") ( IF %WT_Model% == WinBatcher ( ( CALL :WTS_PLMC "%WT_SFDrv%\*.sys") ( CALL :WTS_PLMR "%WT_SFLib%\*.dll") ( CALL :WTS_PLMR "%WT_SFLib%\*.ocx") ( CALL :WTS_PLMI "%WT_SFReg%\[*]HKLM+?.reg") ( CALL :WTS_PLML "%WT_SFCal%\[*]+.cmd") ( CALL :WTS_PLMT "%WT_SFPar%\*.*") ( LABEL %WTHDrv%Win-Traveller [by %USERNAME% as %WTHDrv%] 2>NUL && CALL :WTF_Msg SL. "Done Setting Label") )) ( IF %WT_Model% == WinHooker ( ( CALL :WTS_PLMC "%WT_SFDrv%\*.sys" Un /U) ( CALL :WTS_PLMR "%WT_SFLib%\*.dll" Un /U) ( CALL :WTS_PLMR "%WT_SFLib%\*.ocx" Un /U) ( CALL :WTS_PLMI "%WT_SFReg%\[*]HKLM-?.reg") ( CALL :WTS_PLML "%WT_SFCal%\[*]-.cmd") ( CALL :WTS_PLMT "%WT_SFPar%\*.*") ( LABEL %WTHDrv%Win-Traveller [InAactive] 2>NUL && CALL :WTF_Msg SL. "Done Setting Label") )) ( GOTO :EOF) ::Parse Locale Machine, Copying and Registering System Files :WTS_PLMC ( DIR %1 /-B /-S /A-D-S >%WT_TmpFile% 2>NUL ) &&( CALL :WTF_Msg .L. "%2Registering system files: %~1" ) &&( FOR /F "tokens=1,2,3* usebackq delims=[]" %%I IN (%WT_TmpFile%) DO CALL :WTS_PLMCDo "%%I" "%%J" "%%K" %2 %3) ( GOTO :EOF) :WTS_PLMCDo ( SET WT_Exist=%~2) ( SET WT_Exist=%WT_Exist:+=\%) ( IF NOT EXIST "%WTHome%\%WT_Exist%\%~3" ( ( CALL :WTF_Msg SL. "Skipped , Couldn't Find : %WT_Exist%\%~3") ( GOTO :EOF) )) ( CALL :WTF_Msg .L. "%4Registering system file: %WT_Exist%\%~3") ( IF %WT_Model% == WinBatcher COPY "%WTHome%\%WT_Exist%\%~3" "%WinDir%\system32\drivers\" /Y >>%WT_LogFile% 2>&1) ( REGsvr32.exe %5 /S "%WinDir%\system32\drivers\%~3" >>%WT_LogFile% 2>&1) ( IF %WT_Model% == WinHooker DEL "%WinDir%\system32\drivers\%~3" /F >NUL 2>&1) ( SET WT_Exist=) ( GOTO :EOF) ::Parse Locale Machine, Registering System Files :WTS_PLMR ( DIR %1 /-B /-S /A-D-S >%WT_TmpFile% 2>NUL ) &&( CALL :WTF_Msg .L. "%2Registering system files: %~1" ) &&( FOR /F "tokens=1,2,3* usebackq delims=[]" %%I IN (%WT_TmpFile%) DO CALL :WTS_PLMRDo "%%I" "%%J" "%%K" %2 %3) ( GOTO :EOF) :WTS_PLMRDo ( SET WT_Exist=%~2) ( SET WT_Exist=%WT_Exist:+=\%) ( IF NOT EXIST "%WTHome%\%WT_Exist%\%~3" ( ( CALL :WTF_Msg SL. "Skipped , Couldn't Find : %WT_Exist%\%~3") ( GOTO :EOF) )) ( CALL :WTF_Msg .L. "%4Registering system file: %WT_Exist%\%~3") ( REGsvr32.exe %5 /S "%WTHome%\%WT_Exist%\%~3" >>%WT_LogFile% 2>&1) ( SET WT_Exist=) ( GOTO :EOF) ::Parse Locale Machine, Importing Registry Keys :WTS_PLMI ( DIR %1 /-B /-S /A-D-S >%WT_TmpFile% 2>NUL )&&( CALL :WTF_Msg .L. "Processing WT Registry Files: %~1" )&&( FOR /F "tokens=1,2,3* usebackq delims=[]" %%I IN (%WT_TmpFile%) DO CALL :WTS_PLMIDo "%%I" "%%J" "%%K") ( GOTO :EOF) :WTS_PLMIDo ( SET WT_Exist=%~2) ( SET WT_Exist=%WT_Exist:+=\%) ( IF "%WT_Exist:~-1%" == "!" IF NOT EXIST "%WTHome%\%WT_Exist%" ( ( CALL :WTF_Msg SL. "Skipped Import, Couldn't Find Parent Folder: %WT_Exist%") ( GOTO :EOF) )) ( CALL :WTF_Msg .L. "Importing Registry File: %~1[%~2]%~3") ( TYPE "%~1[%~2]%~3" >%WT_RegFile% 2>NUL) ( TYPE %WT_RegFile% >>%WT_LogFile% 2>NUL) ( SET WT_Convert=%~3) ( IF "%WT_Convert:~5,1%" == "$" IF NOT "%WTHDrv%" == "D:" ( ("%WT_SFSys%\reptxt32.exe" /I %WT_RegFile% D:\ %WTHDrv%\ >>%WT_LogFile% 2>&1) ( TYPE %WT_RegFile% >>%WT_LogFile% 2>NUL) )) ( REG IMPORT %WT_RegFile% >>%WT_LogFile% 2>&1) ( SET WT_Convert=) ( SET WT_Exist=) ( GOTO :EOF) ::Parse Locale Machine, Calling External CMD scripts :WTS_PLML ( DIR %1 /-B /-S /A-D-S >%WT_TmpFile% 2>NUL ) &&( CALL :WTF_Msg .L. "Calling External cmd scripts: %~1" ) &&( FOR /F "tokens=1,2,3* usebackq delims=[]" %%I IN (%WT_TmpFile%) DO CALL :WTS_PLMLDo "%%I" "%%J" "%%K") ( GOTO :EOF) :WTS_PLMLDo ( SET WT_Exist=%~2) ( SET WT_Exist=%WT_Exist:+=\%) ( IF "%WT_Exist:~-1%" == "!" IF NOT EXIST "%WTHome%\%WT_Exist%" ( ( CALL :WTF_Msg SL. "Skipped Calling, Couldn't Find Parent Folder: %WT_Exist%") ( GOTO :EOF) )) ( CALL :WTF_Msg .L. "Calling External cmd scripts: %~1[%~2]%~3") ( TYPE "%~1[%~2]%~3" >>%WT_LogFile% 2>NUL) ( CALL "%~1[%~2]%~3" >>%WT_LogFile% 2>&1) ( SET WT_Exist=) ( GOTO :EOF) ::Parse Locale Machine, Replacing Text in Files :WTS_PLMT ( DIR %1 /-B /-S /A-D-S >%WT_TmpFile% 2>NUL ) &&( CALL :WTF_Msg .L. "Restoring/Replacing drive string: %~1" ) &&( FOR /F "tokens=1,2,3* usebackq delims=[]" %%I IN (%WT_TmpFile%) DO CALL :WTS_PLMTDo "%%I" "%%J" "%%K") ( GOTO :EOF) :WTS_PLMTDo ( SET WT_Exist=%~2) ( SET WT_Exist=%WT_Exist:+=\%) ( IF NOT EXIST "%WTHome%\%WT_Exist%\%~3" ( ( CALL :WTF_Msg SL. "Skipped , Couldn't Find : %WTHome%\%WT_Exist%\%~3") ( GOTO :EOF) ) ELSE ( ( IF NOT EXIST "%WTHome%\%WT_Exist%\%~3.wtb" COPY "%WTHome%\%WT_Exist%\%~3" "%WTHome%\%WT_Exist%\%~3.wtb" /Y >NUL 2>&1) )) ( COPY "%WTHome%\%WT_Exist%\%~3.wtb" "%WTHome%\%WT_Exist%\%~3" /Y >NUL 2>&1) ( IF %WT_Model% == WinBatcher "%WT_SFSys%\reptxt32.exe" /I "%WTHome%\%WT_Exist%\%~3" D:\ %WTHDrv%\>>%WT_LogFile% 2>&1) ( CALL :WTF_Msg .L. "Parsed %WT_Exist%\%~3 File and restored/replaced drive string:") ( SET WT_Exist=) ( GOTO :EOF) : Add/Remove Win-Traveller Registry Keys :WTF_Registry ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( IF %WT_Model% == WinBatcher ( ( IF %WT_ParseLMachine% == 1 ( ( CALL :WTF_Msg SL. "Adding Win-Traveller %WT_Ver% Registry Keys ...") ( REG ADD "%WT_RegKey%" /ve /t REG_DWORD /d 00000001 /F >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Adding Win-Traveller %WT_Ver% WTHome Path ...") ( REG ADD "%WT_RegKey%" /v "WTHome" /t REG_SZ /d ". . %WTHome%" /F >>%WT_LogFile% 2>&1) ( CALL :WTF_Msg SL. "Adding Win-Traveller %WT_Ver% Users Keys ...") ( REG ADD "%WT_RegKey%\Users" /ve /t REG_DWORD /d 00000001 /F >>%WT_LogFile% 2>&1) )) ( CALL :WTF_Msg SL. "Adding Win-Traveller %WT_Ver% current-user: %USERNAME% Key ...") ( REG ADD "%WT_RegKey%\Users" /v "%USERNAME%" /t REG_DWORD /d 00000001 /F >>%WT_LogFile% 2>&1) )) ( IF %WT_Model% == WinHooker ( ( CALL :WTF_Msg SL. "Deleting Win-Traveller %WT_Ver%\Users\%USERNAME% Registry Entry ...") ( REG QUERY "%WT_RegKey%\Users" /v "%USERNAME%" >NUL 2>&1 ) &&( REG DELETE "%WT_RegKey%\Users" /v "%USERNAME%" /F >>%WT_LogFile% 2>&1 ) ||( CALL :WTF_Msg .L. "Not Found, Skipped") ( IF %WT_ParseLMachine% == 1 ( ( CALL :WTF_Msg SL. "Deleting Win-Traveller %WT_Ver% Registry Entry ...") ( REG QUERY "%WT_RegKey%" >NUL 2>&1 ) &&( REG DELETE "%WT_RegKey%" /F >>%WT_LogFile% 2>&1 ) ||( CALL :WTF_Msg .L. "Not Found, Skipped") )) )) ( GOTO :EOF) : Dir, Set/Reset attributes, /Sub Dir :WTF_Attrib ( CALL :WTF_Msg .L. "%2 Attributes: %~1 %3") ( IF %2 == Setting ATTRIB +R +S +H +A %1 %3) ( IF %2 == ReSetting ATTRIB -R -S -H -A %1 %3) ( GOTO :EOF) : Create/Update Win-Traveller $Users Template$ Icons :WTF_Iconics ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( IF %WT_Model% == WinHooker GOTO :EOF) ( IF %WT_Model% == WinBatcher IF EXIST "%WT_SFUsr%" GOTO :EOF) ( IF EXIST "%WT_SFUsr%" CALL :WTF_Msg SL. "Removing WT $User's Template$ ..." & RMDIR "%WT_SFUsr%" /S /Q>NUL 2>&1) ( CALL :WTF_Attrib "%WTHome%\Setup\System\WT-Folder\Desktop.ini" ReSetting) ( CALL :WTF_Msg SL. "Creating/Updating WT $Users Template$ ...") :: Win-travellert Folder ( FOR /D %%D IN (!Favorites !Freeware !Frequent !Programs !Shareware Setup Users) DO CALL :WTS_Ico "\%%~D" "Win-traveller.%%~D") :: Win-travellert\setup Folder ( FOR /D %%D IN (Archives Notes System) DO CALL :WTS_Ico "\Setup\%%~D" "Setup.%%~D") :: Win-travellert\setup\system Folder ( FOR /D %%D IN (Icons Registry Drivers ToRegister ToParse ToCall "$Users template$") DO ( ( CALL :WTS_Ico "\Setup\System\%%~D" "Setup.System.%%~D") )) :: Win-travellert\Setup\System\$Users template$ Folder ( SET WT_UTS=\Setup\System\$Users template$) ( FOR /D %%D IN (Cookies Desktop Favorites NetHood Documents PrintHood Recent SendTo "Start Menu" "Local Settings" Templates Pictures Pictures-Privet Music "My Received Files" Videos Accounts Archives "Bluetooth Exchange Folder" Data Educational Mail Received Movies Web Work Recovery "Azureus Downloads" "WWT Collections" DivX "DivX Author" Downloads "To Print" FrostWire "Any Audio Converter" "Any Video Converter" "My PSP8 Files" Contacts "CDBurnerXP Projects" "Application Data") DO ( ( CALL :WTS_Ico "%WT_UTS%\%%~D" "Setup.System.$Users template$.%%~D") )) ( FOR /D %%D IN ("" \Startup "\Administrative Tools") DO CALL :WTS_Ico "%WT_UTS%\Start Menu\Programs%%~D") ( FOR /D %%D IN ("\Application Data" \History) DO CALL :WTS_Ico "%WT_UTS%\Local Settings%%~D") :: Win-travellert\Setup\System\$Users template$\Favorites\Win-Traveller Folder ( SET WT_SUT=%WT_UTS%\Favorites\Win-Traveller) ( CALL :WTS_Ico "%WT_SUT%" "Win-Traveller") ( FOR /D %%D IN (!Favorites !Freeware !Frequent !Programs !Shareware) DO CALL :WTS_Ico "%WT_SUT%\%%~D" "Win-traveller.%%~D") :: Win-travellert\Setup\System\$Users template$\Favorites\Win-Traveller\ Main Folders ( FOR /D %%G IN (Freeware Programs Shareware) DO ( ( FOR /D %%D IN (Accessories Applications Development Educational Emails Games Internet Management MultiMedia Tools) DO ( ( CALL :WTS_Ico "%WT_SUT%\!%%G\%%~D" "%%G.%%~D") )) ( CALL :WTS_Ico "%WT_SUT%\!%%G\Accessories\Themes" "%%G.Accessories.Themes") )) :: Win-travellert\Setup\System\$Users template$\Favorites\Win-Traveller\!Favorites Folder ( CALL :WTS_Ico "%WT_SUT%\!Favorites\Banks\Finance" "Favorites.Banks.Finance") ( CALL :WTS_Ico "%WT_SUT%\!Favorites\Home\Cooking" "Favorites.Home.Cooking") ( CALL :WTS_Ico "%WT_SUT%\!Favorites\Real Estate\Build" "Favorites.Real Estate.Build") ( FOR /D %%D IN (4Kids Banks "Airlines Travel" Books Cars "Dir Referance" Educational Email Fitness Games Government Graphics Groups Home Insurance Islamics IT Jobsites Marketing Media Medical Mobiles Others Music "Real Estate" Schools Search Shopping Software Trans-Dict TV Tutorials) DO ( ( CALL :WTS_Ico "%WT_SUT%\!Favorites\%%~D" "Favorites.%%~D") )) ( FOR /D %%D IN (Culture Environmental Professionals Social) DO ( ( CALL :WTS_Ico "%WT_SUT%\!Favorites\Groups\%%~D" "Favorites.Groups.%%~D") )) ( FOR /D %%D IN (Broudband "On Line Storage" "On Line Tools" "On Line Web Space" Shops Vendors "Web Hosting") DO ( ( CALL :WTS_Ico "%WT_SUT%\!Favorites\IT\%%~D" "Favorites.It.%%~D") )) ( FOR /D %%D IN (Applications Freeware "Microsoft Web Sites" Tools Updates Drivers) DO ( ( CALL :WTS_Ico "%WT_SUT%\!Favorites\Software\%%~D" "Favorites.Software.%%~D") )) :: Win-travellert\Setup\System\$Users template$\Favorites\Win-Traveller\!Freeware Folder ( CALL :WTS_Ico "%WT_SUT%\!Freeware\Development\Web\Photo Albums" "Freeware.Development.Web.Photo Albums") ( CALL :WTS_Ico "%WT_SUT%\!Freeware\Educational\Islamics" "Freeware.Educational.Islamics") ( FOR /D %%D IN (Compilers Database Editors "Help and Documentation" "Scripting and Installers" Web) DO ( ( CALL :WTS_Ico "%WT_SUT%\!Freeware\Development\%%~D" "Freeware.Development.%%~D") )) ( FOR /D %%D IN (Browsers "Calling Clients" "Download Managers") DO ( ( CALL :WTS_Ico "%WT_SUT%\!Freeware\Internet\%%~D" "Freeware.Internet.%%~D") )) ( FOR /D %%D IN (Desktop Documents "DVDs and CDs" Explorers Files HDs Icons Machine Network Photos System Web) DO ( ( CALL :WTS_Ico "%WT_SUT%\!Freeware\Management\%%~D" "Freeware.Management.%%~D") )) ( FOR /D %%D IN (Encoders LiveTV Players RipGrabRec) DO ( ( CALL :WTS_Ico "%WT_SUT%\!Freeware\MultiMedia\%%~D" "Freeware.MultiMedia.%%~D") )) ( FOR /D %%D IN (AntiVirus "Backups and Archives" "Bench and Speed" "Clean and UnInstall" "Defrag and Optimize" "Erase and Wipe" "Info and Diagnose" "Malware and Adaware" Recovery Security "System Wide") DO ( ( CALL :WTS_Ico "%WT_SUT%\!Freeware\Tools\%%~D" "Freeware.Tools.%%~D") )) :: Win-travellert\Setup\System\$Users template$\Favorites\Win-Traveller\!Frequent Folder ( FOR /D %%D IN (Accessories Control HDs Management Network Programs Security System Win-Traveller) DO ( ( CALL :WTS_Ico "%WT_SUT%\!Frequent\%%~D" "Frequent.%%~D") )) :: ( CALL :WTF_Msg SL. "Processing WT Folder's Icons...") ( CALL :WTF_Attrib "%WTHome%\Setup\System\WT-Folder\Desktop.ini" Setting) ( XCOPY "%WTHome%%WT_SUT%\!Freeware\Desktop.ini" "%WTHome%\!Freeware" /F /H /K /Y /C /R /I /E /S>>%WT_LogFile% 2>&1) ( XCOPY "%WTHome%%WT_SUT%\!Programs\Desktop.ini" "%WTHome%\!Programs" /F /H /K /Y /C /R /I /E /S>>%WT_LogFile% 2>&1) ( XCOPY "%WTHome%%WT_SUT%\!Shareware\Desktop.ini" "%WTHome%\!Shareware" /F /H /K /Y /C /R /I /E /S>>%WT_LogFile% 2>&1) ( SET WT_UTS=) ( SET WT_SUT=) ( IF %WT_Model% == WinIconics CALL :WTF_linKs) ( GOTO :EOF) :WTS_Ico ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( IF NOT EXIST "%WTHome%%~1" MKDIR "%WTHome%%~1" >NUL 2>&1) ( CALL :WTF_Msg .L. "Updating %~1") ( XCOPY "%WTHome%\Setup\System\WT-Folder" "%WTHome%%~1\" /Q /E /H /K /R /Y >NUL 2>&1) ( ECHO [.ShellClassInfo] >"%WTHome%%~1\Desktop.ini" 2>NUL) ( ECHO IconResource="%%WTHome%%\Setup\System\Icons\%~2.ico",0 >>"%WTHome%%~1\Desktop.ini" 2>NUL) ( ECHO IconFile="%%WTHome%%\Setup\System\Icons\%~2.ico" >>"%WTHome%%~1\Desktop.ini" 2>NUL) ( ECHO IconIndex=0 >>"%WTHome%%~1\Desktop.ini" 2>NUL) ( CALL :WTF_Attrib "%WTHome%%~1\Desktop.ini" Setting) ( GOTO :EOF) : Create/Update Win-Traveller Links and System Files :WTF_linKs ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( IF %WT_Model% == WinHooker GOTO :EOF) ( IF %WT_Model% == WinBatcher IF %WT_ParseLMachine% == 0 GOTO :EOF) ( CALL :WTF_Msg SL. "Processing WT Links and System Files...") ( DEL "%WT_SFDrv%\[!*.*" /F>NUL 2>&1) ( DEL "%WT_SFReg%\[!*.*" /F>NUL 2>&1) ( DEL "%WT_SFDrv%\[!*.*" /F>NUL 2>&1) ( DEL "%WT_SFPar%\[!*.*" /F>NUL 2>&1) ( DEL "%WT_SFLib%\[!*.*" /F>NUL 2>&1) ( DEL %WT_TmpFile% /F>>%WT_LogFile% 2>&1) ( CALL :WTF_SearchWF *!) ( ECHO %WTHome%\!Favorites>>%WT_TmpFile% 2>NUL) ( ECHO %WTHome%\!Frequent>>%WT_TmpFile% 2>NUL) ( FOR /F "tokens=* usebackq delims=" %%D IN (%WT_TmpFile%) DO ( ( XCOPY "%%D\Win-Traveller\*.*" "%WTDrv%\Win-Traveller" /F /H /K /Y /C /R /I /E /S>>%WT_LogFile% 2>&1) )) ( GOTO :EOF) : Zip and Package Win-Traveller Program Folder's :WTF_pacKage ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( CALL :WTF_Msg SL. "Parsing %WTHome%,") ( CALL :WTF_Msg SL. "Seeking WT Folder's to Package...") ( CALL :WTF_Msg SL. "Listed on file: %WTHome%\Setup\%WT_SPckl%") ( IF NOT EXIST "%WTHome%\Setup\%WT_SPckl%" GOTO :EOF) ( COPY "%WTHome%\Setup\%WT_SPckl%" %WT_TmpFile% /Y>NUL 2>&1) ( SET /A WT_PCount=1000) ( SET /A WT_FCount=1000) ( FOR /F "tokens=1,2,3 usebackq delims= " %%C IN (`FIND /C "Win-Traveller" %WT_TmpFile%`) DO ( SET /A WT_PCount="1000+%%E")) ( IF "%WT_PCount:~1,3%"=="000" CALL :WTF_Msg SL. "Founded: 0 WT Folder's. Packaging Ended" & GOTO :EOF) ( CALL :WTF_Msg SL. "Founded: %WT_PCount:~1,3% WT Folder's. Packaging Started...") ( FOR /F "usebackq delims=*" %%D IN (%WT_TmpFile%) DO ( ( CALL :WTF_PCount "%%~pnxD") ( "%WT_SFSys%\7za.exe" a -t7z "%%D.wtz" -p%WT_SPass% -mx%WTFrz% -ms -mmt -bd "%%D">NUL 2>>%WT_LogFile% ) &&( CALL :WTF_Msg SL. " Done, Successfully" ) ||( CALL :WTF_Msg SL. " Done, Packaging Failed" & IF EXIST "%%D.wtz" DEL "%%D.wtz" /F>>%WT_LogFile% 2>&1) )) ( SET WT_PCount=) ( SET WT_FCount=) ( SET WT_Msg=) ( GOTO :EOF) : eXpand/Install Win-Traveller Packages :WTF_eXpand ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( IF %WT_Model% == WinHooker GOTO :EOF) ( CALL :WTF_Msg SL. "Parsing %WTHome%,") ( CALL :WTF_Msg SL. "Seeking WT Packages to eXpand/Install...") ( DEL %WT_TmpFile% /F>>%WT_LogFile% 2>&1) ( CALL :WTF_SearchWF *!.wtz -) ( IF NOT EXIST %WT_TmpFile% GOTO :EOF) ( SET /A WT_PCount=1000) ( SET /A WT_FCount=1000) ( FOR /F "tokens=1,2,3 usebackq delims= " %%C IN (`FIND /C "!.wtz" %WT_TmpFile%`) DO SET /A WT_PCount="1000+%%E") ( IF "%WT_PCount:~1,3%"=="000" CALL :WTF_Msg SL. "Founded: 0 WT Packages. eXpantion/Install Ended" & GOTO :EOF) ( CALL :WTF_Msg SL. "Founded: %WT_PCount:~1,3% WT Packages. eXpantion/Install Started...") ( SET WT_ParseLMachine=1) ( FOR /F "usebackq delims=*" %%D IN (%WT_TmpFile%) DO ( ( CALL :WTF_PCount "%%~pnxD") ( IF EXIST "%%~dpnD" (RD "%%~dpnD" /S /Q>>%WT_LogFile% 2>&1 || CALL :WTF_Msg SL. " Failed to Remove %%~dpnD")) ("%WT_SFSys%\7za.exe" x "%%D" -o"%%~dpD" -aoa -p%WT_SPass%>NUL 2>>%WT_LogFile% ) &&( ( DEL "%%D" /S /Q>>%WT_LogFile% 2>&1 ) &&( CALL :WTF_Msg SL. " Done, Successfully" ) ||( CALL :WTF_Msg SL. " Done, Successfully but Failed to Remove %%~nxD") ) ||( CALL :WTF_Msg SL. " Done, Installation Failed") )) ( SET WT_PCount=) ( SET WT_FCount=) ( SET WT_Msg=) ( GOTO :EOF) : Progress Counter to keep count of Files :WTF_PCount ( SET /A WT_FCount=%WT_FCount%+1) ( SET WT_Msg=%~1) ( SET WT_Msg=%WT_Msg:\Win-Traveller\=%) ( CALL :WTF_Msg SL. "[%WT_FCount:~1,3%-%WT_PCount:~1,3%] %WT_Msg%...") ( GOTO :EOF) : Search Dir and output to file :WTF_Search (( FOR /F "tokens=*" %%X IN ('DIR %1 /B /A%2D') DO ( ECHO %~dp1%%X) >>%WT_TmpFile% 2>NUL)2>NUL) ( GOTO :EOF) : Search Dir with Filter and output to file :WTF_SearchWF ( FOR /D %%G IN (!Freeware !Programs !Shareware) DO ( ( FOR /D %%D IN (Accessories Applications Development Educational Emails Games Internet Management MultiMedia Tools ) DO ( ( CALL :WTF_Search "%WTHome%\%%G\%%~D\%1" %2) )) ( FOR /D %%D IN (Themes) DO CALL :WTF_Search "%WTHome%\%%G\Accessories\%%~D\%1" %2) )) ( FOR /D %%D IN (Islamics) DO CALL :WTF_Search "%WTHome%\!Freeware\Educational\%%~D\%1" %2) ( FOR /D %%D IN (Compilers Database Editors "Help and Documentation" "Scripting and Installers" Web "Web\Photo albums") DO ( ( CALL :WTF_Search "%WTHome%\!Freeware\Development\%%~D\%1" %2) )) ( FOR /D %%D IN (Desktop Documents "DVDs and CDs" Explorers Files HDs Icons Machine Network Photos System Web) DO ( ( CALL :WTF_Search "%WTHome%\!Freeware\Management\%%~D\%1" %2) )) ( FOR /D %%D IN (Encoders LiveTV Players RipGrabRec) DO ( ( CALL :WTF_Search "%WTHome%\!Freeware\MultiMedia\%%~D\%1" %2) )) ( FOR /D %%D IN (AntiVirus "Backups and Archives" "Bench and Speed" "Clean and UnInstall" "Defrag and Optimize" "Erase and Wipe" "Info and Diagnose" "Malware and Adaware" Recovery Security "System Wide") DO ( ( CALL :WTF_Search "%WTHome%\!Freeware\Tools\%%~D\%1" %2) )) ( FOR /D %%D IN (Browsers "Calling Clients" "Download Managers") DO ( ( CALL :WTF_Search "%WTHome%\!Freeware\Internet\%%~D\%1" %2) )) ( GOTO :EOF) : Restart Explorer and Shell :WTF_ShellRestart ( IF %WTDeb% == 1 >>%WT_DebFile% ECHO %0 %*) ( CALL :WTF_Msg SL. "Shutting down windows Shell") ( "%WT_SFSys%\taskkill.exe" /IM explorer.exe /F>>%WT_LogFile% 2>&1) ( SET WT_IconCachedb="%USERPROFILE%\Local Settings\Application Data\IconCache.db") ( IF EXIST %WT_IconCachedb% CALL :WTF_Attrib %WT_IconCachedb% ReSetting) ( DEL %WT_IconCachedb% /Q /F 2>NUL && CALL :WTF_Msg SL. "Deleted IconCache") ( SET WT_IconCachedb=) ( CALL :WTF_Msg SL. "Restarting windows Shell") ( START /B explorer.exe) ( GOTO :EOF) : End of Program :WTL_End ( ENDLOCAL ) ( EXIT)