Solved if errorlevel 1 goto :EOF

October 29, 2013 at 06:32:49
Specs: Windows 2008
i'm try to get a bat file to run properly. if my file finds a certain word in a file i want it to run completely. if it doesnt find the word i want it to do a :eof right now it always runs the whole script. here is copy of script...

@echo off
FIND /I "X-Sender" < "d:\gfi\mailessentials\emailsecurity\failedmails\*.txt" > nul
if errorlevel 1 goto :EOF

net stop listserv /yes && net start listserv
net stop gfiasmlhost /yes && net start gfiasmlhost
net stop gfiscans /yes && net start gfiscans
net stop msecavupdate /yes && net start msecavupdate
net stop GFIScanM /yes && net start GFIScanM
net stop msecmlhost /yes && net start msecmlhost
net stop gfimetrxsvc /yes && net start gfimetrxsvc
net stop gfiasmsecatt /yes && net start gfiasmsecatt
net stop csecmlhost /yes && net start csecmlhost
net stop gfipop2exch /yes && net start gfipop2exch
net start listserv
net start msecavupdate
net start gfipop2exch

cd d:\gfi\mailessentials\emailsecurity\failedmails && d:

del *.prop
ren *.txt *.eml

move d:\gfi\mailessentials\emailsecurity\failedmails\*.eml d:\exchange\transportroles\pickup

copy d:\gfi.eml "d:\exchange\transportroles\pickup"


See More: if errorlevel 1 goto :EOF

Report •

October 29, 2013 at 08:07:19
✔ Best Answer
FIND /I "X-Sender" < "d:\gfi\mailessentials\emailsecurity\failedmails\*.txt" > nul


FIND /I "X-Sender" "d:\gfi\mailessentials\emailsecurity\failedmails\*.txt" > nul

How To Ask Questions The Smart Way

Report •

October 29, 2013 at 08:22:55
that was it. i found this after i posted. but thank you for your help.

Report •

Related Solutions

Ask Question