@echo off&set FileName=%~n0&shift :: ============================================= :: AutoHelp PlugLab Concept: 2006 by Reatogo :: ============================================= :: Help Info: :: ======================= set Routine_Type=3 :: 1=Getting Data 2=Prompts 3=Getting Files 4=Creating Files 5=General set Routine_Vers=1 set Routine_Date=2007-02-15 set RoutineName=GetDocs set RoutineAuthor=Siegfried set Using_work_from= set Example_call_1=%%GetDocs%% "appdata" "Mozilla\Firefox" "" "" "" "" "" "" "" "" set Example_call_2= set Example_call_3= set text_01=HELP Still T O D O if "%~1" == "GetHelp" goto :EOF :: ============================================= echo %* if not "%DocsPrepDone%" == "1" call :CREATE_PROFILE_FOLDERS set DocsPrepDone=1 set docType=&set docFolder=&set docSource=&set docTarget= set docType=%~1&shift set docFolder=%~1 if "%~1" == "" (set BkSl=) else set BkSl=\ set isFile=yes :: not 0 = has extension -> is a file if "%~x1" == "" set isFile=no if "%isFile%" == "yes" goto MainDoc :: up to 20 files to be excluded :: ============= set a=0 :EXCLLOOP if "%a%" == "20" goto ENDEXCLLOOP set /a a+=1 if %a% LSS 10 set NUM=0%a% if %a% LSS 10 (set ExclFil-%NUM%=%~1& shift ) else set ExclFil-%a%=%~1& shift goto EXCLLOOP :ENDEXCLLOOP set a=& set NUM= :: ============= :MainDoc %Msg% "Copy files from user profile ..." if /I "%docType%" == "app" set docType=Appdata if /I "%docType%" == "allapp" set docType=AllAppdata ::Default User :: ====================== if /I "%docType%" == "Profile" set docSource=%HOST_PROFILE%%&set docTarget=%PLUG_PROFILE%&goto docTypeFound if /I "%docType%" == "User" set docSource=%HOST_USER%&set docTarget=%PLUG_USER%&goto docTypeFound if /I "%docType%" == "Appdata" set docSource=%HOST_APPDATA%&set docTarget=%PLUG_APPDATA%&goto docTypeFound if /I "%docType%" == "Quicklaunch" set docSource=%HOST_QUICKLAUNCH%&set docTarget=%PLUG_QUICKLAUNCH%&goto docTypeFound if /I "%docType%" == "Icache" set docSource=%HOST_ICACHE%&set docTarget=%PLUG_ICACHE%&goto docTypeFound if /I "%docType%" == "History" set docSource=%HOST_HISTORY%&set docTarget=%PLUG_HISTORY%&goto docTypeFound if /I "%docType%" == "Mydocs" set docSource=%HOST_MYDOCS%&set docTarget=%PLUG_MYDOCS%&goto docTypeFound if /I "%docType%" == "Mypict" set docSource=%HOST_MYPICT%&set docTarget=%PLUG_MYPICT%&goto docTypeFound if /I "%docType%" == "Mymusic" set docSource=%HOST_MYMUSIC%&set docTarget=%PLUG_MYMUSIC%&goto docTypeFound if /I "%docType%" == "Myvideo" set docSource=%HOST_MYVIDEO%&set docTarget=%PLUG_MYVIDEO%&goto docTypeFound if /I "%docType%" == "Desktop" set docSource=%HOST_DESKTOP%&set docTarget=%PLUG_DESKTOP%&goto docTypeFound if /I "%docType%" == "Favorites" set docSource=%HOST_FAVORITES%&set docTarget=%PLUG_FAVORITES%&goto docTypeFound if /I "%docType%" == "Cookies" set docSource=%HOST_COOKIES%&set docTarget=%PLUG_COOKIES%&goto docTypeFound if /I "%docType%" == "Printhood" set docSource=%HOST_PRINTHOOD%&set docTarget=%PLUG_PRINTHOOD%&goto docTypeFound if /I "%docType%" == "Nethood" set docSource=%HOST_NETHOOD%&set docTarget=%PLUG_NETHOOD%&goto docTypeFound if /I "%docType%" == "Sendto" set docSource=%HOST_SENDTO%&set docTarget=%PLUG_SENDTO%&goto docTypeFound if /I "%docType%" == "Templates" set docSource=%HOST_TEMPLATES%&set docTarget=%PLUG_TEMPLATES%&goto docTypeFound if /I "%docType%" == "Recent" set docSource=%HOST_RECENT%&set docTarget=%PLUG_RECENT%&goto docTypeFound if /I "%docType%" == "Admtools" set docSource=%HOST_ADMTOOLS%&set docTarget=%PLUG_ADMTOOLS%&goto docTypeFound if /I "%docType%" == "Accessories" set docSource=%HOST_ACCESSORIES%&set docTarget=%PLUG_ACCESSORIES%&goto docTypeFound if /I "%docType%" == "Startup" set docSource=%HOST_STARTUP%&set docTarget=%PLUG_STARTUP%&goto docTypeFound :: All Users :: ====================== if /I "%docType%" == "AllUsers" set docSource=%HOST_ALLUSER%&set docTarget=%PLUG_ALLUSER%&goto docTypeFound if /I "%docType%" == "AllAppdata" set docSource=%HOST_ALLAPPDATA%&set docTarget=%PLUG_ALLAPPDATA%&goto docTypeFound if /I "%docType%" == "AllQuicklaunch" set docSource=%HOST_ALL_QUICKLAUNCH%&set docTarget=%PLUG_ALL_QUICKLAUNCH%&goto docTypeFound if /I "%docType%" == "AllDocs" set docSource=%HOST_ALL_MYDOCS%&set docTarget=%PLUG_ALL_MYDOCS%&goto docTypeFound if /I "%docType%" == "AllPict" set docSource=%HOST_ALL_MYPICT%&set docTarget=%PLUG_ALL_MYPICT%&goto docTypeFound if /I "%docType%" == "AllMusic" set docSource=%HOST_ALL_MYMUSIC%&set docTarget=%PLUG_ALL_MYMUSIC%&goto docTypeFound if /I "%docType%" == "AllVideo" set docSource=%HOST_ALL_MYVIDEO%&set docTarget=%PLUG_ALL_MYVIDEO%&goto docTypeFound if /I "%docType%" == "AllDesktop" set docSource=%HOST_ALL_DESKTOP%&set docTarget=%PLUG_ALL_DESKTOP%&goto docTypeFound if /I "%docType%" == "AllFavorites" set docSource=%HOST_ALL_FAVORITES%&set docTarget=%PLUG_ALL_FAVORITES%&goto docTypeFound if /I "%docType%" == "AllTemplates" set docSource=%HOST_ALL_TEMPLATES%&set docTarget=%PLUG_ALL_TEMPLATES%&goto docTypeFound if /I "%docType%" == "AllAdmtools" set docSource=%HOST_ALL_ADMTOOLS%&set docTarget=%PLUG_ALL_ADMTOOLS%&goto docTypeFound if /I "%docType%" == "AllAccessories" set docSource=%HOST_ALL_ACCESSORIES%&set docTarget=%PLUG_ALL_ACCESSORIES%&goto docTypeFound if /I "%docType%" == "AllStartup" set docSource=%HOST_ALL_STARTUP%&set docTarget=%PLUG_ALL_STARTUP%&goto docTypeFound :docTypeFound :: ====================== if exist "%docSource%%BkSl%%docFolder%%docFile%" xcopy "%docSource%%BkSl%%docFolder%%docFile%" "%docTarget%%BkSl%%docFolder%" /I /E /R /Y /C /H if "%isFile%" == "yes" goto _END_DOCS SETLOCAL ENABLEDELAYEDEXPANSION :: delete the excluded files and folders for /f "tokens=2 delims==" %%i in ('set ExclFil- 2^>nul') do ( if exist "%docTarget%\%docFolder%\%%i\*.*" (rd "%docTarget%\%docFolder%\%%i" /s /q ) else if exist "%docTarget%\%docFolder%\%%i" del "%docTarget%\%docFolder%\%%i" /q ) ENDLOCAL :_END_DOCS goto :EOF :: ============================================= :CREATE_PROFILE_FOLDERS :: ======================= if exist "PROFILES" rd "PROFILES" /s /q md "%PLUG_APPDATA%" md "%PLUG_ALLAPPDATA%" if not exist "PROFILES\%Prog_On_CD%.tag" echo.> "PROFILES\%Prog_On_CD%.tag" goto :EOF :: =======================