Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: IF statement  (Read 2131 times)

0 Members and 1 Guest are viewing this topic.

rao

    Topic Starter


    Greenhorn
    IF statement
    « on: April 15, 2009, 02:51:32 AM »
    My script is as below
    Set A=1
    echo %time% "Outside Procedure"
    sleep 2
    if %A% NEQ 0 (
    echo %time% "inside procedure"
    sleep 2
    echo %time% "inside procedure"
    )

    Time command inside IF condition gets the same time instead of 2 second different. How to overcome this inside IF statement?

    Pls Advice,
    Krishnarao.

    fireballs



      Apprentice

    • Code:Terminal
    • Thanked: 3
      Re: IF statement
      « Reply #1 on: April 15, 2009, 02:58:12 AM »
      Code: [Select]
      setlocal enabledelayedexpansion

      blah...
      if....(
      echo !time!
      ...)
      blah...

      we've all been there.

      FB
      Next time google it.

      rao

        Topic Starter


        Greenhorn
        Re: IF statement
        « Reply #2 on: April 15, 2009, 03:21:12 AM »
        It worked Thanks Many... :)