File Name:mla-copy-version.bat
@echo off
setLocal EnableDelayedExpansion
rem The Batch file copies the Version sheet text files into the Deployment Servers
set Wasserver=%1
set domain=%2
set depserver=%3
set cruiseuser=%4
set cruisepwd=%5
set Envname=%6
set AppFlag=%7
set Flag=%AppFlag%
Echo set Wasserver=%1
Echo set domain=%2
Echo set depserver=%3
echo set cruiseuser=%4
echo set cruisepwd=%5
echo set Envname=%6
echo set AppFlag=%7
IF %Flag% == LF (goto :copyLF)
IF %Flag% == SM (goto :copySM)
IF %Flag% == DMS (goto :copyDMS)
IF %Flag% == Batch (goto :copyBatch)
IF %Flag% == Stub (goto :copyStub)
:copyLF
for /f "tokens=1,2 delims=. " %%a in ("%WasServer%") do set wasser=%%a&set LFdomain=%%b
echo %wasser%
echo %LFdomain%
if exist R: (net use R: /delete)
Echo net use R: \\%WasServer%\d$ /user:%LFdomain%\cruiseuser cruisepwd
net use R: \\%WasServer%\d$ /user:%LFdomain%\%cruiseuser% %cruisepwd%
sleep 2
echo Xcopy \\%WasServer%\d$\LF-AppDetails.txt /Y d:\Apps\Automation\%Envname%\AutomatedDeploy\Scripts\target\%Envname%\MLA\
Xcopy \\%WasServer%\d$\LF-AppDetails.txt /Y d:\Apps\Automation\%Envname%\AutomatedDeploy\Scripts\target\%Envname%\MLA\
if exist R: (net use R: /delete)
goto :end
:copySM
for /f "tokens=1,2 delims=. " %%a in ("%WasServer%") do set wasser=%%a&set SMdomain=%%b
echo %wasser%
echo %LFdomain%
if exist R: (net use R: /delete)
Echo net use R: \\%WasServer%\d$ /user:%SMdomain%\cruiseuser cruisepwd
net use R: \\%WasServer%\d$ /user:%SMdomain%\%cruiseuser% %cruisepwd%
sleep 2
Xcopy \\%WasServer%\d$\SM-AppDetails.txt /Y d:\Apps\Automation\%Envname%\AutomatedDeploy\Scripts\target\%Envname%\MLA\
if exist R: (net use R: /delete)
goto :end
:copyDMS
echo "inside DMS"
for /f "tokens=1,2 delims=. " %%a in ("%WasServer%") do set wasser=%%a&set DMSdomain=%%b
echo %wasser%
echo %DMSdomain%
if exist R: (net use R: /delete)
Echo net use R: \\%WasServer%\d$ /user:%DMSdomain%\cruiseuser cruisepwd
net use R: \\%WasServer%\d$ /user:%DMSdomain%\%cruiseuser% %cruisepwd%
sleep 2
Xcopy \\%WasServer%\d$\DMS-AppDetails.txt /Y d:\Apps\Automation\%Envname%\AutomatedDeploy\Scripts\target\%Envname%\MLA\
if exist R: (net use R: /delete)
goto :end
:copyBatch
echo %WasServer%
if exist R: (net use R: /delete)
Echo net use R: \\%WasServer%\d$ /user:%LFdomain%\cruiseuser cruisepwd
net use R: \\%WasServer%\d$ /user:%LFdomain%\%cruiseuser% %cruisepwd%
sleep 2
echo Xcopy \\%WasServer%\d$\Batch-versions-list.txt /Y d:\Apps\Automation\%Envname%\AutomatedDeploy\Scripts\target\%Envname%\MLA\
Xcopy \\%WasServer%\d$\Batch-versions-list.txt /Y d:\Apps\Automation\%Envname%\AutomatedDeploy\Scripts\target\%Envname%\MLA\
sleep 5
if exist R: (net use R: /delete)
goto :end
:copyStub
echo %WasServer%
if exist R: (net use R: /delete)
Echo net use R: \\%WasServer%\d$ /user:%LFdomain%\cruiseuser cruisepwd
net use R: \\%WasServer%\d$ /user:%LFdomain%\%cruiseuser% %cruisepwd%
sleep 2
Xcopy \\%WasServer%\d$\wss-version.txt /Y d:\Apps\Automation\%Envname%\AutomatedDeploy\Scripts\target\%Envname%\MLA\
if exist R: (net use R: /delete)
goto :end
:end
No comments:
Post a Comment
Do not post irrelevant comments, please!