Batch - How to handle multiple IF conditions

I wanted to have multiple IF conditions so how can i use that

Page 1 of 1

1 Replies - 5767 Views - Last Post: 28 September 2009 - 03:47 PM Rate Topic: -----

#1 yogeshs   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-September 09

Batch - How to handle multiple IF conditions

Post icon  Posted 24 September 2009 - 10:54 PM

How to handle multiple IF conditions in a batch scripting
Ex:-
For /f "tokens=5" %%i in (6.txt) do set ci=%%i
IF %ci% EQU 2 (				 [b]first if start[/b]
For /f "tokens=3" %%i in (6.txt) do set Tl=%%i
set Th=%Tl:~0,2%
set Tm=%Tl:~3,2%
Set TL=%Th%%Tm%
For /f "tokens=2" %%j in (4.txt) do set Tj=%%j
set /A Clc=%Tf%-%TL%
set /A Day=%dt%-%Tj%
:del 4.txt
echo %clc%
echo %Day%
set bool=0
IF "%clc%" GEQ "800" set /a yy=%yy%+1
IF "%Day%" GTR "1" set /a yy=%yy%+1
IF %yy% LEQ 2 (
taskkill /F /IM calc.exe
) ELSE (
taskkill /F /IM notepad.exe
	)
) ELSE (					[b]first if end[/b]
echo Bye Bye
	)



Thanks in advance

This post has been edited by yogeshs: 24 September 2009 - 11:20 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Batch - How to handle multiple IF conditions

#2 SpooksDF   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 06-April 09

Re: Batch - How to handle multiple IF conditions

Posted 28 September 2009 - 03:47 PM

I think you should use if... else... statements. I am just guessing. :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1