Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Batch File not executing Do - Loop - Maybe a vbscript will do ? Windows 2003 Server

Avatar of LindaC
LindaCFlag for Puerto Rico asked on
Windows Server 2003Windows BatchVB Script
30 Comments1 Solution748 ViewsLast Modified:
I have the following script but the DO - LOOP is only executing once and do not execut the "hot_CMDB_backup_end.bat".

I f the loop will execute like a loop then it will run perfectly.  The thing is that I don't know how to do it in batch file or maybe in vbscript?

Attached is the script.
set newDate=%date:~4,2%-%date:~7,2%-%date:~10%
set arg=CMDB

start C:\oracle\Dba\scripts\CMDB\hot_backup_scripts\hot_CMDB_backup.bat

C:
cd C:\Program Files\Veritas\NetBackup\bin
start bpbackup -p Windows-Servers-dbs -s %arg% -L C:\oracle\Dba\logs\CMDB\hot_backup_logs\%arg%_28_Hotback.%newDate%.log -f C:\oracle\Dba\scripts\CMDB\hot_backup_scripts\%arg%list.txt
set var_stop=1

Do 

	sleep 10
	tasklist.exe /fi "IMAGENAME eq bpbackup.exe">C:\oracle\Dba\logs\CMDB\hot_backup_logs\borrame.txt
	tasklist.exe /fi "IMAGENAME eq bpbkar32.exe”>>C:\oracle\Dba\logs\CMDB\hot_backup_logs\borrame.txt
	tasklist.exe /fi "IMAGENAME eq bpcd.exe”>>C:\oracle\Dba\logs\CMDB\hot_backup_logs\borrame.txt
	findstr /i /s "bpbackup.exe bpbkar32.exe bpcd.exe" C:\oracle\Dba\logs\CMDB\hot_backup_logs\borrame.txt
	echo error level is %errorlevel% >>C:\oracle\Dba\logs\CMDB\hot_backup_logs\logfile.txt
	if %errorlevel% equ 0 (echo Todavía está corriendo el envío a Veritas > C:\oracle\Dba\logs\CMDB\hot_backup_logs\Verificacion.log ) 
	if %errorlevel% equ 1 (echo Terminó el envio a Veritas >> C:\oracle\Dba\logs\CMDB\hot_backup_logs\Verificacion.log) & start C:\oracle\Dba\scripts\CMDB\hot_backup_scripts\hot_CMDB_backup_end.bat & Exit Do
Loop

exit;
ASKER CERTIFIED SOLUTION
Avatar of t0t0
t0t0Flag of United Kingdom of Great Britain and Northern Ireland image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 30 Comments.
See Answers