Or ...
put the full path in the script.
Eg
echo ------------------------------------------------------------------------------------ > %LOGFILE%
echo Summary Report by Status Code >> %LOGFILE%
echo ------------------------------------------------------------------------------------ >> %LOGFILE%
C:\Progra~1\Veritas\NetBackup\bin\admincmd\bperror -backstat -by_statcode -U -hoursago 24 >> %LOGFILE%
I don't understand why people don't set the PATH variable on the OS - I sit on webex and watch people type in long paths every time they run a command.
You could set the path to the command as a variable in the script .
eg
set ADMINCMD="C:\Progra~1\Veritas\NetBackup\bin\admincmdt"
Then use
%ADMINCMD%\bperror -backstat -by_statcode -U -hoursago 24 >> %LOGFILE%
That way, you don't have paths in the script (well, only once) and it's neater + will work on any machine.
To set the paths, see part A in here
https://www-secure.symantec.com/connect/forums/netbackup-basics-and-how-make-your-life-easier
Martin