I am the Build Master at my company and am responsible for running our code deploys. Part of this process involves monitoring the server logs to make sure that everything succeeds and comes back online. I wrote a batch script to open up the logs automatically so I didn't have to do it manually. I have written a script where I can enter the server I want to look at and it will open up all the correct logs from that server. My problem is that I would like for the script to start back over once it opens the logs, because there are many times when I need to deploy to multiple servers at once and I would prefer to not have to re-run the script, but for some reason it always closes once it opens up the logs. I will provide some of the code I am using below.
@echo off
:Begin
echo.
echo Select Environment (HELP to List Options)
set /p Environment=""
if "%Environment%" == "HELP" (
GOTO LIST_ENV
) else if "%Environment%" == "Stop" (
GOTO:EOF
) else if "%Environment%" == "Dev02" (
%Environment% = dgisweb02
GOTO NON_BATCH
This section prompts me to enter a server name, or HELP, to get a list of the servers. Then it goes through if/if else statements to set the proper server name for the environment I want. I have many more environments but it wasn't necessary to list them all for the purpose of this question.
:NON_BATCH
%SystemRoot%\explorer.exe "\\%Environment%\gwlogs\ContactManager\logs\ablog.log"
%SystemRoot%\explorer.exe "\\%Environment%\gwlogs\BillingCenter\logs\bclog.log"
%SystemRoot%\explorer.exe "\\%Environment%\gwlogs\ClaimCenter\logs\cclog.log"
%SystemRoot%\explorer.exe "\\%Environment%\gwlogs\PolicyCenter\logs\pclog.log"
GOTO Begin
This is the NON_BATCH section that it jumps to once I would input "Dev02". The issue is that it never reaches the GOTO Begin, which should send it back up to the :Begin label at the top of the script, right? Any advice would be helpful, I don't have a lot of experience with making Batch Scripts and just made this to make my life a little easier.
EDIT So it appears that it never actually enters into this NON_BATCH section. Instead, it opens up a separate batch file that I had created a while ago to open up those logs, called Dev02.bat. I am not really sure why it's calling that file.