Announcement

Collapse
No announcement yet.

If Statement

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • If Statement

    Could someone provide a snippet for IF condition:

    IF "file exist" at "program files\sub dir\sub dir\file.exe" do not download file.exe.

    I am Using (it's not working) the following:

    ; IF REGISTER.EXE DOES NOT EXIST, DO COPY COMMAND.
    ;BEGIN IF STATEMENT

    IF (%ProgramFiles%\\ssbyjess\\register.exe = 0)

    Copy Files C:\register.exe-> %ProgramFiles%\ssbyjess)

    END IF

    ;END OF IF STATEMENT

    1. C:\register.exe does exist

    2. C:\Program Files\ssbyjess does exist

    3. C:\Program Files\ssbyjess\register.exe does not exist


    Thanks in advance!

    [This message has been edited by locc (edited 04-17-2002).]

    [This message has been edited by locc (edited 04-17-2002).]

    [This message has been edited by locc (edited 04-17-2002).]

  • #2
    Re: If Statement

    You need to search for the file with an action first, and then test the result of that action in the IF statement.

    Right now, you're just testing whether the string:

    %ProgramFiles%\\ssbyjess\\register.exe = 0

    ...is false, which it is, because all strings in an expression are false. (The only exception is the word "true".)
    --[[ Indigo Rose Software Developer ]]

    Comment


    • #3
      Re: If Statement

      Hello Lorne,

      Could you provide an example?

      I learn quick from examples!

      Thank you,

      Comment

      Working...
      X