Pass control from a Batch file to user

January 5, 2011 at 17:01:33
Specs: Windows xp
Is it possible to write a batch file where I setup some parameters and then pass control to user so he can do his tasks and then wait for Exit statement from user?

Example:
I am writing a script that'll do an initial setup of setting CVSROOT and logging into cvs repository with the user provided credentials. Once login is complete it'll pass control to user so that he can work in the cvs repository and wait for an exit statement to bring control back to batch file.
I normally do a lot of cvs work and hate having to open a dos windows, set CVSROOT and login each time on different machines. So instead want a script that i can just double-click and which will do the initialization for me.

My script looks as follows:

:CVSSCRIPT
echo Executing CVS Script

set user=%1
set pwd=%2
set /P user=Enter cvs UserName:
if [%user%]==[] GOTO:EOF
set /P pwd=Enter cvs Password:
if [%pwd%]==[] GOTO:EOF

cd\ & cvs -z6 -d :pserver:%2:%3@cvsserver.stc.com:/cvs/QA-CM login
if [%errorlevel%] == [1] GOTO:EOF

cd c:\ats

GOTO:EOF

Need something after cd c:\ats
Thanks


See More: Pass control from a Batch file to user

Report •


#1
January 6, 2011 at 03:36:27
:: CVSSCRIPT
@echo off
title CVS WINDOW

echo. & echo.Executing CVS Script

set user=%1
set pwd=%2

set /P user=Enter cvs UserName^> 
if not defined user goto :EOF
set /P pwd=Enter cvs Password^> 
if not defined pwd goto :EOF

cd \
cvs -z6 -d :pserver:%2:%3@cvsserver.stc.com:/cvs/QA-CM login || goto :EOF
cd /D C:\ats

cmd /K "cls & echo. & echo.TYPE EXIT TO RELEASE CONTROL BACK"

echo.CONTROL RELEASED & pause


Report •

#2
January 6, 2011 at 09:38:24
That script worked like a charm. Thank you very much!!

Report •
Related Solutions


Ask Question