Avatar of westone
westone
Flag for United States of America

asked on 

Batch file

Hi,
I am trying to get the following to work in a batch. Can someone tell me what is wrong with this? I can't figure it out. This section is run by "IF ERRORLEVEL 0 GOTO:Report". Even when the error level is 0 (confirmed by echoing the error level) nothing in this section runs.
Thank You.
:Report
If "%TOTAL%" GTR 0 (
		SET SUB="Successful Data Backup"
		SET TXT1="The Data Backup was successful. %TOTAL% new and/or updated file(s) were copied to the encrypted external drive. No Errors were encountered."
		GOTO:DISMOUNT
	) Else (
	If "%TOTAL%"== 0 (
		SET SUB="Successful Data Backup"
		SET TXT1="The Data Backup ran successfully, however no new or modified files requiring backup were found." 
		GOTO:DISMOUNT
	  )
	 )

Open in new window

Windows Batch

Avatar of undefined
Last Comment
AmazingTech

8/22/2022 - Mon