School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,032 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,215 people online right now. Registration is fast and FREE... Join Now!




Batch - How to handle multiple IF conditions

 

Batch - How to handle multiple IF conditions, I wanted to have multiple IF conditions so how can i use that

yogeshs

24 Sep, 2009 - 09:54 PM
Post #1

New D.I.C Head
*

Joined: 24 Sep, 2009
Posts: 1

How to handle multiple IF conditions in a batch scripting
Ex:-
CODE

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 Sep, 2009 - 10:20 PM

User is offlineProfile CardPM
+Quote Post


SpooksDF

RE: Batch - How To Handle Multiple IF Conditions

28 Sep, 2009 - 02:47 PM
Post #2

New D.I.C Head
*

Joined: 6 Apr, 2009
Posts: 10


My Contributions
I think you should use if... else... statements. I am just guessing. biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 08:30AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month