jeffwest21
IS-IT--Management
I have the following in a batch file
The issue here is two fold
1. It seems to run through ok, but doesn't log the Echo in the logfiles
2. It does both echo commands when it does, don't suppose anyone can see what I have got wrong here.
'Clever boy...'
Code:
@echo on
setlocal
set LogPath=\\Bridata\user drives\JeffWset LogFileExt=.log
set LogFileName=Daily Backup%LogFileExt%
::use set MyLogFile=%date:~4% instead to remove the day of the week
set MyLogFile=%date%
set MyLogFile=%MyLogFile:/=-%
set MyLogFile=%LogPath%%MyLogFile%_%LogFileName%
::Note that the quotes are REQUIRED around %MyLogFIle% in case it contains a space
If NOT Exist "%MyLogFile%" goto:noseparator
Echo.>>"%MyLogFile%"
Echo.===================>>"%MyLogFile%"
:noseparator
echo.%Date% >>"%MyLogFile%"
echo.%Time% >>"%MyLogFile%"
:startbatch
if exist {\\bridata\Master Drive\CCP\Rostrvm\Output\Park_Test\UK\parkbad.csv}
(
sqlcmd -Q "exec dbo.Park_Output" -S bridevsql01 -d Park
Echo This Has prossessed the files>>"%MyLogFile%"
)else
(
Echo This has Not Processed any files>>"%MyLogFile%"
)
The issue here is two fold
1. It seems to run through ok, but doesn't log the Echo in the logfiles
2. It does both echo commands when it does, don't suppose anyone can see what I have got wrong here.
'Clever boy...'