•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Computer Science and Software Design section within the Software Development category of DaniWeb, a massive community of 391,581 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,675 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Computer Science and Software Design advertiser:
Views: 2978 | Replies: 3
![]() |
•
•
Join Date: Jul 2004
Posts: 17
Reputation:
Rep Power: 5
Solved Threads: 0
hopefully any of the experts out there could help clear my suspicion...the 2 IF statements in my .bat file seem logiclly correct but it deosn't seem to work as I expected :
1) IF /I %varX% NEQ %varY%
2) IF NOT %varX%==%varY%
whereby the %varX% and %varY% are actually numeric digits extracted from a file (but numeric digits or not shouldn't matter as the /I should be taking care of it so the least case 1 should work...too bad it doesn't also :cry: )
looks so simple yet so complicated to code :mad: HELP :eek:
1) IF /I %varX% NEQ %varY%
2) IF NOT %varX%==%varY%
whereby the %varX% and %varY% are actually numeric digits extracted from a file (but numeric digits or not shouldn't matter as the /I should be taking care of it so the least case 1 should work...too bad it doesn't also :cry: )
looks so simple yet so complicated to code :mad: HELP :eek: •
•
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,333
Reputation:
Rep Power: 11
Solved Threads: 101
•
•
Join Date: Aug 2004
Posts: 49
Reputation:
Rep Power: 4
Solved Threads: 1
Have you tried:
IF NOT "%varX%" == "%varY%"
IF NOT "%varX%" == "%varY%"
•
•
Join Date: Jul 2004
Posts: 17
Reputation:
Rep Power: 5
Solved Threads: 0
•
•
•
•
Originally Posted by felgall
Have you tried:
IF NOT "%varX%" == "%varY%"
Hiya, yeah, i h've tried it too but doesn't seem to work either....i suspect it's unable to take care of the condition if say %varX% is blank. Cos' my .bat file is actually in this sequence :
FIND "Counter" d:\local.dat > d:\read.txt
FOR /F "tokens=3* delims=" %%i in (d:\read.txt) do set varX=%%i
IF NOT "%varX%" == "%varY%" echo Diff
whereby the IF statement doesn't work only when the %varX% is found to be blank due to the word "Counter" is not exist in d:\local.dat file. How can I handle this situation then? :o
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Computer Science and Software Design Marketplace
•
•
•
•
ajax applications asp blog business business software computer dell design developer development erp systems firefox india intel internet it java linux media microsoft mmorpg mobile applications msdn networking news office open open-source operating programming project management registry rss science security software software selection source sql sun super system technology evaluation vista web wiki windows xp
- Mail command (Shell Scripting)
- ftp problem in winxp system (Windows NT / 2000 / XP / 2003)
- 3 computers on 1 broadband router, only 1 will connect to internet...need help asap (Networking Hardware Configuration)
- Files & streams? (C++)
- Help!! Applet only works in AppletViewer but not in html file with <applet> tags!!! (Java)
- Linux has come a long way (Getting Started and Choosing a Distro)
- connecting to DB (PHP)
- Problem with XP and DNS error (Viruses, Spyware and other Nasties)
Other Threads in the Computer Science and Software Design Forum
- Previous Thread: how would you make your own programming language
- Next Thread: New To Programming



Linear Mode