Questions

How Can I Modify this batch file so it copies the file to the F drive?

+
0 Votes
Locked

How Can I Modify this batch file so it copies the file to the F drive?

shaneco
A former colleague created this program to copy user profiles, settings and favorites to a network drive. I want to use this batch file to copy files to usb flash drive on f drive:

the network drive is iomega-01ddae\public\dump.
PC.Evergreen.%computername% I would like to change PC.evergreen to something else.

Here is the code:

@echo off
title J + J's Profile Magic v2.1.9
color 1F
goto menu
:menu
cls
echo.
echo.
echo.
echo ????????????????????????????????????????????????????????????????????????????????????????????
echo ?? J + J's Profile Magic v2.1.9 ??
echo ?? A PC Evergreen Production ??
echo ????????????????????????????????????????????????????????????????????????????????????????????
echo ?? ?? ?? The Time for Choosing is NOW! ?? ?? ??
echo ????????????????????????????????????????????????????????????????????????????????????????????
echo ?? ??
echo ?? 1 Copy Everything to External Drive ??
echo ?? ??
echo ?? 2 Restore Everything from External Drive ??
echo ?? ??
echo ?? I Mount the PC Evergreen NAS to B: ??
echo ?? ??
echo ?? M Mount a Share to B: ??
echo ?? ??
echo ?? U Unmount a Share from B: ??
echo ?? ??
echo ?? Q Quit - I'm Done Like Dinner ??
echo ?? ??
echo ????????????????????????????????????????????????????????????????????????????????????????????
echo.

:choice
set /P C= [1,2,I,M,U,Q]?
if "%C%"=="q" goto quit
if "%C%"=="Q" goto quit
if "%C%"=="m" goto mount
if "%C%"=="M" goto mount
if "%C%"=="u" goto unmount
if "%C%"=="U" goto unmount
if "%C%"=="i" goto iomega
if "%C%"=="I" goto iomega
if "%C%"=="2" goto restore-all
if "%C%"=="1" goto copy-all
goto choice


REM Below are the menu options

:copy-all
set /P source=[Please Enter The Drive Letter to Backup From]
set /P drive=[Please Enter The Drive Letter to Backup To]

call :win2000check

:: This part converts the inputted drives to uppercase to provide compatability with the find & replace VB script.
call :stringToUpper %source%
set source=%STRING%
call :stringToUpper %drive%
set drive=%STRING%

mkdir %DRIVE%:\PC.Evergreen.%computername%\

if exist "%SOURCE%:\documents and settings\*.000" dir "%SOURCE%:\documents and settings\*.000" /b /a:d-h /l > %DRIVE%:\PC.Evergreen.%computername%\users-000.txt
if exist "%DRIVE%:\PC.Evergreen.%computername%\users-000.txt" cscript %DRIVE%:\Profile.Backup\replace.vbs "%DRIVE%:\PC.Evergreen.%computername%\users-000.txt" ".000" ""
if exist "%DRIVE%:\PC.Evergreen.%computername%\users-000.txt" for /F "delims= " %%G in (%DRIVE%:\PC.Evergreen.%computername%\users-000.txt) do call :user-000 "%%G"

if exist "%SOURCE%:\documents and settings\*.r2" dir "%SOURCE%:\documents and settings\*.r2" /b /a:d-h /l > %DRIVE%:\PC.Evergreen.%computername%\users-r2.txt
if exist "%DRIVE%:\PC.Evergreen.%computername%\users-r2.txt" cscript %DRIVE%:\Profile.Backup\replace.vbs "%DRIVE%:\PC.Evergreen.%computername%\users-r2.txt" ".r2" ""
if exist "%DRIVE%:\PC.Evergreen.%computername%\users-r2.txt" for /F "delims= " %%H in (%DRIVE%:\PC.Evergreen.%computername%\users-r2.txt) do call :user-r2 "%%H"

dir "%SOURCE%:\documents and settings\" /b /a:d-h /l > %DRIVE%:\PC.Evergreen.%computername%\users.txt
for /F "delims= " %%I in (%DRIVE%:\PC.Evergreen.%computername%\users.txt) do call :filecopy "%%I"

call :rootcopy

:: The following line is being made obsolete.
:: It creates a copy of Profile Magic in each backup, cluttering the storage device and making backups take longer.
:: In its stead, Profile Magic is copied down to the local PC.Evergreen.[computer] folder upon restoring.
:: xcopy %DRIVE%:\Profile.Backup\* %drive%:\PC.Evergreen.%computername%\Profile.Backup\ /E /V /Y /exclude:%DRIVE%:\Profile.Backup\USMT30\logExclude.txt

if %source%==C (
%DRIVE%:\Profile.Backup\USMT30\scanstate.exe %DRIVE%:\PC.Evergreen.%computername%\ /l:%DRIVE%:\Profile.Backup\USMT30\logs\ScanState.%computername%.log /i:%DRIVE%:\Profile.Backup\USMT30\miguser.xml /i:%DRIVE%:\Profile.Backup\USMT30\exclude.xml /uel:90 /ui:r2\*

echo.
echo Profile Magic will now release this computer's IP address back to the pool...
echo.

pause

ipconfig /release
) else (
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo The files were backed up successfully.
echo.
echo Please note that a USMT backup was NOT created.
echo The backup consists of only user files, which will have to be manually restored.
echo.
pause
)

goto menu


:restore-all
set /P drive=[Please Enter The Drive Letter to Restore From]
set /P oldcomputername=[Please Enter The Name of the Old Computer]

:: %SOURCE% must be "C" here to make win2000check run properly
set source=C
call :win2000check

if not exist %drive%:\Profile.Backup (
echo.
echo.
echo Profile Magic folder is missing. Cannot continue with restore.
echo.
echo Returning to main menu...
pause
goto menu
)
if exist %drive%:\PC.Evergreen.%oldcomputername%\* (
xcopy %drive%:\PC.Evergreen.%oldcomputername%\* C:\PC.Evergreen.%oldcomputername%\ /E /V
xcopy %drive%:\Profile.Backup\* C:\PC.Evergreen.%oldcomputername%\Profile.Backup\ /E /V /Y /exclude:%DRIVE%:\Profile.Backup\USMT30\logExclude.txt

if exist "C:\PC.Evergreen.%oldcomputername%\root\*" xcopy "C:\PC.Evergreen.%oldcomputername%\root\*" "C:\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\profile.root\*" xcopy "C:\PC.Evergreen.%oldcomputername%\profile.root\*" "C:\documents and settings\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Scheduled.Tasks\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Scheduled.Tasks\*" "C:\windows\tasks\" /E /V /Y

REM This will restore the E7000 Profile and MIS ID and Windows Settings
if exist "C:\PC.Evergreen.%oldcomputername%\E7000\*" xcopy "C:\PC.Evergreen.%oldcomputername%\E7000\*" "C:\%winPath%\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\E7000batch\*.bat" xcopy "C:\PC.Evergreen.%oldcomputername%\E7000batch\*.bat" "C:\tdshcm\"

REM This will restore the settings for Reflection, if they exist
if exist "C:\PC.Evergreen.%oldcomputername%\Reflection.Settings\*.r1w" xcopy "C:\PC.Evergreen.%oldcomputername%\Reflection.Settings\*.r1w" "C:\Program Files\Reflection\User\" /y

REM This will restore the Telemed folder, if it exists
if exist "C:\PC.Evergreen.%oldcomputername%\Telemed.Settings\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Telemed.Settings\*" "C:\Program Files\Telemed for Windows\" /y

REM This will restore the settings for UTS Express 2.0, if they exist.
if exist "C:\PC.Evergreen.%oldcomputername%\UTS.Express.Settings\ux2cfg.ini" xcopy "C:\PC.Evergreen.%oldcomputername%\UTS.Express.Settings\ux2cfg.ini" "C:\express2\" /y
if exist "C:\PC.Evergreen.%oldcomputername%\UTS.Express.Settings\qpcommon.ini" xcopy "C:\PC.Evergreen.%oldcomputername%\UTS.Express.Settings\qpcommon.ini" "C:\%winPath%\" /y

REM This will restore the settings for TN3270, if they exist.
if exist "C:\PC.Evergreen.%oldcomputername%\TN3270.Settings\*" xcopy "C:\PC.Evergreen.%oldcomputername%\TN3270.Settings\*" "C:\Program Files\SDI\TN3270 Plus\" /y

REM This will restore the settings for Airsource Pro, if they exist.
if exist "C:\PC.Evergreen.%oldcomputername%\Airsource.Pro.Settings\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Airsource.Pro.Settings\*" "C:\airpro\" /y

REM This will restore the settings for PTCT, if they exist.
if exist "C:\PC.Evergreen.%oldcomputername%\PTCT.Settings\*" xcopy "C:\PC.Evergreen.%oldcomputername%\PTCT.Settings\*" "C:\" /y

C:\PC.Evergreen.%oldcomputername%\Profile.Backup\USMT30\loadstate.exe C:\PC.Evergreen.%oldcomputername%\ /c /q /v:13 /i:C:\PC.Evergreen.%oldcomputername%\Profile.Backup\USMT30\miguser.xml /i:C:\PC.Evergreen.%oldcomputername%\Profile.Backup\USMT30\exclude.xml /l:C:\LoadState.log /uel:90 /ui:r2\* /lac /lae
dir "c:\documents and settings\" /b /a:d-h /l > C:\PC.Evergreen.%oldcomputername%\users-new.txt
for /F "delims= " %%G in (C:\PC.Evergreen.%oldcomputername%\users-new.txt) do call :filerestore "%%G"
pause
) else (
echo.
echo The folder %drive%:\PC.Evergreen.%oldcomputername%\ doesn't exist.
echo.
pause
)
goto menu


:mount
set /P volume=[Please Enter The Share You Wish To Mount To]

:iomega
if %C%==i set volume=\\iomega-01ddae\public\dump
if %C%==I set volume=\\iomega-01ddae\public\dump

echo.
if exist b: (
echo Removing any previously existing share mounted to B:...
net use b: /delete
echo.
)
echo Mounting share to B:...
net use b: %volume%
pause
goto menu


:unmount
if exist b: (
echo Deleting B:...
net use b: /delete
) else (
echo Drive B: was not found.
)
pause
goto menu


rem Below are the functions to be called

:user-000
C:
cd \
cd "documents and settings"
ren "%~1" "%~1".old
ren "%~1".000 "%~1"
goto :eof

:user-r2
C:
cd \
cd "documents and settings"
ren "%~1" "%~1".old
ren "%~1".r2 "%~1"
goto :eof

:filecopy
if exist "%SOURCE%:\Documents and Settings\%~1\My Documents\*" xcopy "%SOURCE%:\Documents and Settings\%~1\My Documents\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\My Documents\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Favorites\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Favorites\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Favorites\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Desktop\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Desktop\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Desktop\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Recent\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Recent\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Recent\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Local Settings\Application Data\Microsoft\Outlook\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Local Settings\Application Data\Microsoft\Outlook\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Archive\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Outlook\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Outlook\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Outlook\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Signatures\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Signatures\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Signatures\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Proof\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Proof\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Dictionary\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Templates\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Templates\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Templates\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Internet Explorer\Quick Launch\*" xcopy "%SOURCE%:\Documents and Settings\%~1\Application Data\Microsoft\Internet Explorer\Quick Launch\*" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Quick.Launch\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Start Menu\Programs\Startup\*.bat" xcopy "%SOURCE%:\Documents and Settings\%~1\Start Menu\Programs\Startup\*.bat" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Startup\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\Start Menu\Programs\Startup\*.cmd" xcopy "%SOURCE%:\Documents and Settings\%~1\Start Menu\Programs\Startup\*.cmd" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Startup\" /E /V /Y
if exist "%SOURCE%:\Documents and Settings\%~1\*.doc" xcopy "%SOURCE%:\Documents and Settings\%~1\*.doc" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Other\"
if exist "%SOURCE%:\Documents and Settings\%~1\*.xls" xcopy "%SOURCE%:\Documents and Settings\%~1\*.xls" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Other\"
if exist "%SOURCE%:\Documents and Settings\%~1\*.pdf" xcopy "%SOURCE%:\Documents and Settings\%~1\*.pdf" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Other\"
if exist "%SOURCE%:\Documents and Settings\%~1\*.ppt" xcopy "%SOURCE%:\Documents and Settings\%~1\*.ppt" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Other\"
if exist "%SOURCE%:\Documents and Settings\%~1\*.jpg" xcopy "%SOURCE%:\Documents and Settings\%~1\*.jpg" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Other\"
if exist "%SOURCE%:\Documents and Settings\%~1\*.gif" xcopy "%SOURCE%:\Documents and Settings\%~1\*.gif" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Other\"
if exist "%SOURCE%:\Documents and Settings\%~1\*.mdb" xcopy "%SOURCE%:\Documents and Settings\%~1\*.mdb" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Other\"
if exist "%SOURCE%:\Documents and Settings\%~1\*.epf" xcopy "%SOURCE%:\Documents and Settings\%~1\*.epf" "%DRIVE%:\PC.Evergreen.%computername%\Users\%~1\Other\"
goto :eof

:filerestore
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\My Documents\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\My Documents\*" "C:\Documents and Settings\%~1\My Documents\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Favorites\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Favorites\*" "C:\Documents and Settings\%~1\Favorites\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Desktop\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Desktop\*" "C:\Documents and Settings\%~1\Desktop\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Other\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Other\*" "C:\Documents and Settings\%~1\Desktop\Other\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Recent\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Recent\*" "C:\Documents and Settings\%~1\Recent\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Outlook\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Outlook\*" "C:\Documents and Settings\%~1\Application Data\Microsoft\Outlook\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Archive\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Archive\*" "C:\Documents and Settings\%~1\Local Settings\Application Data\Microsoft\Outlook\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Signatures\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Signatures\*" "C:\Documents and Settings\%~1\Application Data\Microsoft\Signatures\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Dictionary\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Dictionary\*" "C:\Documents and Settings\%~1\Application Data\Microsoft\Proof\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Templates\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Templates\*" "C:\Documents and Settings\%~1\Application Data\Microsoft\Templates\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Quick.Launch\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Quick.Launch\*" "C:\Documents and Settings\%~1\Application Data\Microsoft\Internet Explorer\Quick Launch\" /E /V /Y
if exist "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Startup\*" xcopy "C:\PC.Evergreen.%oldcomputername%\Users\%~1\Startup\*" "C:\Documents and Settings\%~1\Start Menu\Programs\Startup\" /E /V /Y
goto :eof


:rootcopy
if exist "%SOURCE%:\*.doc" xcopy "%SOURCE%:\*.doc" "%DRIVE%:\PC.Evergreen.%computername%\Root\"
if exist "%SOURCE%:\*.xls" xcopy "%SOURCE%:\*.xls" "%DRIVE%:\PC.Evergreen.%computername%\Root\"
if exist "%SOURCE%:\*.pdf" xcopy "%SOURCE%:\*.pdf" "%DRIVE%:\PC.Evergreen.%computername%\Root\"
if exist "%SOURCE%:\*.ppt" xcopy "%SOURCE%:\*.ppt" "%DRIVE%:\PC.Evergreen.%computername%\Root\"
if exist "%SOURCE%:\*.jpg" xcopy "%SOURCE%:\*.jpg" "%DRIVE%:\PC.Evergreen.%computername%\Root\"
if exist "%SOURCE%:\*.gif" xcopy "%SOURCE%:\*.gif" "%DRIVE%:\PC.Evergreen.%computername%\Root\"
if exist "%SOURCE%:\*.mdb" xcopy "%SOURCE%:\*.mdb" "%DRIVE%:\PC.Evergreen.%computername%\Root\"
if exist "%SOURCE%:\*.epf" xcopy "%SOURCE%:\*.epf" "%DRIVE%:\PC.Evergreen.%computername%\Root\"

if exist "%SOURCE%:\documents and settings\*.doc" xcopy "%SOURCE%:\documents and settings\*.doc" "%DRIVE%:\PC.Evergreen.%computername%\Profile.Root\"
if exist "%SOURCE%:\documents and settings\*.xls" xcopy "%SOURCE%:\documents and settings\*.xls" "%DRIVE%:\PC.Evergreen.%computername%\Profile.Root\"
if exist "%SOURCE%:\documents and settings\*.pdf" xcopy "%SOURCE%:\documents and settings\*.pdf" "%DRIVE%:\PC.Evergreen.%computername%\Profile.Root\"
if exist "%SOURCE%:\documents and settings\*.ppt" xcopy "%SOURCE%:\documents and settings\*.ppt" "%DRIVE%:\PC.Evergreen.%computername%\Profile.Root\"
if exist "%SOURCE%:\documents and settings\*.jpg" xcopy "%SOURCE%:\documents and settings\*.jpg" "%DRIVE%:\PC.Evergreen.%computername%\Profile.Root\"
if exist "%SOURCE%:\documents and settings\*.gif" xcopy "%SOURCE%:\documents and settings\*.gif" "%DRIVE%:\PC.Evergreen.%computername%\Profile.Root\"
if exist "%SOURCE%:\documents and settings\*.mdb" xcopy "%SOURCE%:\documents and settings\*.mdb" "%DRIVE%:\PC.Evergreen.%computername%\Profile.Root\"
if exist "%SOURCE%:\documents and settings\*.epf" xcopy "%SOURCE%:\documents and settings\*.epf" "%DRIVE%:\PC.Evergreen.%computername%\Profile.Root\"

REM This will copy any scheduled tasks there may be.
if exist "%SOURCE%:\%winPath%\tasks\*.job" xcopy "%SOURCE%:\%winPath%\tasks\*.job" "%DRIVE%:\PC.Evergreen.%computername%\Scheduled.Tasks\"

REM This will find any printers and export them to TXT for reference
if %source%==C (
md %DRIVE%:\PC.Evergreen.%computername%\Printers\
reg query "HKCU\Printers" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKCU\Printers\Connections" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Devices" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKCU\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKLM\SOFTWARE\LEXMARK\UnstLog >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKLM\System\CurrentControlSet\Control\Print\Connections" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\SJRH-PS-W01\Printers" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers\Novell iPrint Services\PortNames" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKLM\SYSTEM\ControlSet001\Control\Print\Providers\Novell iPrint Services\PortNames" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
reg query "HKLM\SYSTEM\ControlSet002\Control\Print\Providers\Novell iPrint Services\PortNames" >> %DRIVE%:\PC.Evergreen.%computername%\Printers\Printers.txt /s
)

REM This will export any autologin settings to a TXT file for reference
if %source%==C (
md %DRIVE%:\PC.Evergreen.%computername%\Autologin\
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName>>%DRIVE%:\PC.Evergreen.%computername%\Autologin\Autologin.txt
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword>>%DRIVE%:\PC.Evergreen.%computername%\Autologin\Autologin.txt
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName>>%DRIVE%:\PC.Evergreen.%computername%\Autologin\Autologin.txt
)

REM This will dump the IP configuration into a TXT file for reference
if %source%==C (
mkdir %DRIVE%:\PC.Evergreen.%computername%\IPConfig
ipconfig /all>%DRIVE%:\PC.Evergreen.%computername%\IPConfig\IPConfig.txt
)

REM This will copy all E7000 settings
md %DRIVE%:\PC.Evergreen.%computername%\E7000\
if exist "%SOURCE%:\%winPath%\W2.CFG" xcopy "%SOURCE%:\%winPath%\W2.CFG" "%DRIVE%:\PC.Evergreen.%computername%\E7000\"
if exist "%SOURCE%:\%winPath%\W2HCM.INI" xcopy "%SOURCE%:\%winPath%\W2HCM.INI" "%DRIVE%:\PC.Evergreen.%computername%\E7000\"
if exist "%SOURCE%:\%winPath%\W2HCM.prd" xcopy "%SOURCE%:\%winPath%\W2HCM.prd" "%DRIVE%:\PC.Evergreen.%computername%\E7000\"
if exist "%SOURCE%:\%winPath%\W2HCM.tst" xcopy "%SOURCE%:\%winPath%\W2HCM.tst" "%DRIVE%:\PC.Evergreen.%computername%\E7000\"
if exist "%DRIVE%:\PC.Evergreen.%computername%\E7000\W2HCM.ini" cscript %DRIVE%:\Profile.Backup\replace.vbs "%DRIVE%:\PC.Evergreen.%computername%\E7000\W2HCM.ini" "%SOURCE%:\Program Files\SNA\system\wappc32.dll" "%SOURCE%:\Program Files\Host Integration Server\system\wappc32.dll"
if exist "%DRIVE%:\PC.Evergreen.%computername%\E7000\W2HCM.prd" cscript %DRIVE%:\Profile.Backup\replace.vbs "%DRIVE%:\PC.Evergreen.%computername%\E7000\W2HCM.prd" "%SOURCE%:\Program Files\SNA\system\wappc32.dll" "%SOURCE%:\Program Files\Host Integration Server\system\wappc32.dll"
if exist "%DRIVE%:\PC.Evergreen.%computername%\E7000\W2HCM.tst" cscript %DRIVE%:\Profile.Backup\replace.vbs "%DRIVE%:\PC.Evergreen.%computername%\E7000\W2HCM.tst" "%SOURCE%:\Program Files\SNA\system\wappc32.dll" "%SOURCE%:\Program Files\Host Integration Server\system\wappc32.dll"
if exist "%SOURCE%:\tdshcm\*.bat" md %DRIVE%:\PC.Evergreen.%computername%\E7000batch\
if exist "%SOURCE%:\tdshcm\*.bat" xcopy "%SOURCE%:\tdshcm\*.bat" "%DRIVE%:\PC.Evergreen.%computername%\E7000batch\"

REM This will copy the settings for Reflection, if they exist
if exist "%SOURCE%:\Program Files\Reflection\User\*.r1w" xcopy "%SOURCE%:\Program Files\Reflection\User\*.r1w" "%DRIVE%:\PC.Evergreen.%computername%\Reflection.Settings\"

REM This will copy the Telemed folder, if it exists.
if exist "%SOURCE%:\Program Files\Telemed for Windows\*" xcopy "%SOURCE%:\Program Files\Telemed for Windows\*" "%DRIVE%:\PC.Evergreen.%computername%\Telemed.Settings\"

REM This will copy the UTS Express 2.0 settings, if they exist.
if exist "%SOURCE%:\express2\ux2cfg.ini" xcopy "%SOURCE%:\express2\ux2cfg.ini" "%DRIVE%:\PC.Evergreen.%computername%\UTS.Express.Settings\"
if exist "%SOURCE%:\%winPath%\qpcommon.ini" xcopy "%SOURCE%:\%winPath%\qpcommon.ini" "%DRIVE%:\PC.Evergreen.%computername%\UTS.Express.Settings\"

REM This will copy the TN3270 settings, if they exist.
if exist "%SOURCE%:\Program Files\SDI\TN3270 Plus\*" xcopy "%SOURCE%:\Program Files\SDI\TN3270 Plus\*" "%DRIVE%:\PC.Evergreen.%computername%\TN3270.Settings\"

REM This will copy the Airsource Pro settings, if they exist.
if exist "%SOURCE%:\airpro\*" xcopy "%SOURCE%:\airpro\*" "%DRIVE%:\PC.Evergreen.%computername%\Airsource.Pro.Settings\"

REM This will copy the .the and .qrp files from the AGFA installation, if they exist
REM They won't be restored automatically but rather backed up in case they become necessary.
if exist "%SOURCE%:\Program Files\agfa\ris\programs\*.the" xcopy "%SOURCE%:\Program Files\agfa\ris\programs\*.the" "%DRIVE%:\PC.Evergreen.%computername%\AGFA.Settings\THE.Files\"
if exist "%SOURCE%:\Program Files\agfa\ris\programs\*.qrp" xcopy "%SOURCE%:\Program Files\agfa\ris\programs\*.qrp" "%DRIVE%:\PC.Evergreen.%computername%\AGFA.Settings\QRP.Files\"

REM This will copy the folders used by PTCT, if they exist.
if exist "%SOURCE%:\PtCTClnt" xcopy "%SOURCE%:\PtCTClnt\*" "%DRIVE%:\PC.Evergreen.%computername%\PTCT.Settings\PtCTClnt\"
if exist "%SOURCE%:\PTCTcomn" xcopy "%SOURCE%:\PTCTcomn\*" "%DRIVE%:\PC.Evergreen.%computername%\PTCT.Settings\PTCTcomn\"
if exist "%SOURCE%:\PtCTRep" xcopy "%SOURCE%:\PtCTRep\*" "%DRIVE%:\PC.Evergreen.%computername%\PTCT.Settings\PtCTRep\"
if exist "%SOURCE%:\PtCTClntold" xcopy "%SOURCE%:\PtCTClntold\*" "%DRIVE%:\PC.Evergreen.%computername%\PTCT.Settings\PtCTClntold\"
if exist "%SOURCE%:\PTCTcomnold" xcopy "%SOURCE%:\PTCTcomnold\*" "%DRIVE%:\PC.Evergreen.%computername%\PTCT.Settings\PTCTcomnold\"
if exist "%SOURCE%:\PtCTRepOld" xcopy "%SOURCE%:\PtCTRepOld\*" "%DRIVE%:\PC.Evergreen.%computername%\PTCT.Settings\PtCTRepOld\"
if exist "%SOURCE%:\*ptct*.*" xcopy "%SOURCE%:\*ptct*.*" "%DRIVE%:\PC.Evergreen.%computername%\PTCT.Settings\"
goto :eof


:stringToUpper
:: This function is used to convert strings to uppercase.
:: It's usage is as follows:
::
:: call :stringToUpper [string/variable]
:: set [string/variable]=%STRING%
:: It is necessary to provide compatability with the find & replace VB script, which is case-sensitive.
SET STRING=%~1
IF [%STRING%]==[] GOTO:EOF
SET STRING=%STRING:a=A%
SET STRING=%STRING:b=B%
SET STRING=%STRING:c=C%
SET STRING=%STRING:d=D%
SET STRING=%STRING:e=E%
SET STRING=%STRING:f=F%
SET STRING=%STRING:g=G%
SET STRING=%STRING:h=H%
SET STRING=%STRING:i=I%
SET STRING=%STRING:j=J%
SET STRING=%STRING:k=K%
SET STRING=%STRING:l=L%
SET STRING=%STRING:m=M%
SET STRING=%STRING:n=N%
SET STRING=%STRING:o=O%
SET STRING=%STRING:p=P%
SET STRING=%STRING:q=Q%
SET STRING=%STRING:r=R%
SET STRING=%STRING:s=S%
SET STRING=%STRING:t=T%
SET STRING=%STRING:u=U%
SET STRING=%STRING:v=V%
SET STRING=%STRING:w=W%
SET STRING=%STRING:x=X%
SET STRING=%STRING:y=Y%
SET STRING=%STRING:z=Z%
goto :eof

:win2000check
:: This part provides compatability with Windows 2000, which uses C:\WINNT\ as its install folder and has no reg.exe by default.
if exist "%SOURCE%:\windows\" set winPath=windows
if exist "%SOURCE%:\winnt\" set winPath=winnt
if not exist %SOURCE%:\%winpath%\system32\reg.exe xcopy %DRIVE%:\Profile.Backup\reg.exe %SOURCE%:\%winpath%\system32\
goto :eof

:quit
exit
:end
  • +
    0 Votes
    SmartAceW0LF

    for a bit more specialized purpose than just to copy a users profile from one place to another.

    Specifically, it calls for specific usernames and specific folders presumably all of which are related to an orderly nomenclature known by the admin for the most part. In addition to pre-defined usernames and host names, it assumes all target machines are running Pre-Vista Windows Operating Systems and have certain other software and scripts available to effect other processes from within the same script.

    So as a batch file, from my limited experience of same, it would appear to me that minus the VBS script it makes the call to this would be rendered moot. Again, I could be wrong and it would not be the first time but I do know that the script calls for far more than what exists normally on most machines.

    It does not appear to me that you will likely be able to simply cut and paste to modify the usage of it in order to effect its use in another environment.

  • +
    0 Votes
    SmartAceW0LF

    for a bit more specialized purpose than just to copy a users profile from one place to another.

    Specifically, it calls for specific usernames and specific folders presumably all of which are related to an orderly nomenclature known by the admin for the most part. In addition to pre-defined usernames and host names, it assumes all target machines are running Pre-Vista Windows Operating Systems and have certain other software and scripts available to effect other processes from within the same script.

    So as a batch file, from my limited experience of same, it would appear to me that minus the VBS script it makes the call to this would be rendered moot. Again, I could be wrong and it would not be the first time but I do know that the script calls for far more than what exists normally on most machines.

    It does not appear to me that you will likely be able to simply cut and paste to modify the usage of it in order to effect its use in another environment.