Search found 3 matches
- 26 Jun 2012 20:24
- Forum: DOS Batch Forum
- Topic: Batch file awlays exit with o
- Replies: 7
- Views: 6852
Re: Batch file awlays exit with o
Basically, I have start.txt file which is null. The other file a.txt will be either null or has some content (I have just put aaaaaa in a.txt). I want to check if a.txt is null or not. If a.txt is null, I want return code as 0 else 1. For this, I created dummy empty file start.txt and comparing a.tx...
- 26 Jun 2012 16:48
- Forum: DOS Batch Forum
- Topic: Batch file awlays exit with o
- Replies: 7
- Views: 6852
Re: Batch file awlays exit with o
It gives 0 even if files are same or not. It should return 0 for same and 1 for different files. How to do this?
- 26 Jun 2012 12:52
- Forum: DOS Batch Forum
- Topic: Batch file awlays exit with o
- Replies: 7
- Views: 6852
Batch file awlays exit with o
I have below script where I am comparing 2 files. If the files are same, script should exit with 0, else script should exit with 1. In below code, it always exit with 0. How can I achieve above with the below script?
@echo off
:main
fc start.txt a.txt
:End
exit %ERRORLEVEL%
@echo off
:main
fc start.txt a.txt
:End
exit %ERRORLEVEL%