Skip to content

Instantly share code, notes, and snippets.

@013
Last active December 21, 2015 01:48
Show Gist options
  • Save 013/6230031 to your computer and use it in GitHub Desktop.
Save 013/6230031 to your computer and use it in GitHub Desktop.
REM Do not change these until you have ran the script for a first time
set currentlogin=ral
set olduser=esguser
set newuser=CORP.USER
if NOT "%olduser%" == "esguser" (GOTO scan)
mkdir C:\m
xcopy \\srv-mir-fp02\ral$\1\* C:\m\ /E
REM AV Installation --------------------------------------------------------------------------------
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (set b=64)
if "%PROCESSOR_ARCHITECTURE%" == "x86" (set b=32)
mkdir C:\m\av
xcopy "\\wds\DeploymentShare\Applications\Symantec AV %b% bit 12.1.2" C:\m\av /E
"C:\m\av\Setup.exe /s"
REM AV Installation --------------------------------------------------------------------------------
REM If the olduser hasn't been set, open notepad ---------------------------------------------------
if "%olduser%" == "esguser" (
start %comspec% /c "mode 45,10&title &echo.&echo. start.bat will need editing before running&echo. Line 2 ^& 3 - New ^& old usernames&echo. notepad ^& explorer will now open &echo.&pause"
notepad.exe C:\m\start.bat
explorer.exe C:\m
REM --------------------------------------
exit
)
:scan
REM Scanstate --------------------------------------------------------------------------------------
if %currentlogin% == %olduser% (
REM "C:\m\USMT\%PROCESSOR_ARCHITECTURE%\scanstate.exe" C:\backup /o /vsc /v:0 /l:"C:\m\scanstate.log" /progress:"C:\m\progress.log" /i:"C:\m\USMT\%PROCESSOR_ARCHITECTURE%\MigApp.xml" /i:"C:\m\USMT\%PROCESSOR_ARCHITECTURE%\MigUser.xml" /i:"C:\m\xml\ExcludeDrive.xml" /ue:*\* /ui:*\%olduser%
"C:\m\USMT\%PROCESSOR_ARCHITECTURE%\scanstate.exe" C:\backup /o /vsc /v:0 /l:"C:\m\scanstate.log" /ue:*\* /ui:*\%olduser%
)
REM Loadstate --------------------------------------------------------------------------------------
if %currentlogin% == %newuser% (
REM "C:\m\USMT\%PROCESSOR_ARCHITECTURE%\loadstate.exe" C:\backup /i:"C:\m\USMT\%PROCESSOR_ARCHITECTURE%\MigApp.xml" /i:"C:\m\USMT\%PROCESSOR_ARCHITECTURE%\MigUser.xml" /mu:ESG\%olduser%:CORP\%newuser% /l:"C:\m\scanstate.log" /progress:"C:\m\progress.log"
"C:\m\USMT\%PROCESSOR_ARCHITECTURE%\loadstate.exe" C:\backup /mu:ESG\%olduser%:CORP\%newuser% /l:"C:\m\loadstate.log"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment