1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

ELSE Problem in batchfile

Discussion in 'Other PC Software' started by edmund085, 2009/04/24.

  1. 2009/04/24
    edmund085

    edmund085 Inactive Thread Starter

    Joined:
    2009/04/24
    Messages:
    4
    Likes Received:
    0
    Help!
    I have a problem about the Else statement in the batch file.

    :variables
    IF exist C:\program1\_OOLEMUP.MSF rename C:\program1\_OOLEMUP.MSF fedx.exe
    IF not exist C:\program1\_OOLEMUP.MSF rename C:\program1\mawee.exe wowe.exe
    IF exist C:\program1\wowe.exe (ECHO File wowe.exe exist) ELSE (start notepad.exe)
    If defined C:\program1\cow.exe GOTO makelist
    If not defined C:\hexmixer.doc copy wowe.exe C:\program2
    GOTO MENU

    the problem is that the else statement doesnt even the file wowe.exe is esisted. The command 2 doesnt execute but the first command execute. Pls help. And also, how do type If defined statements, because it wont work either, and i dont understand it's use.:(
     
  2. 2009/04/24
    wildfire

    wildfire Getting Old

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Hi Edmund and welcome to windows bbs :D

    A good starting point would be what windows version you are using?

    There are several errors in your batch file but if you answer the above I'll post a correct version and where you went wrong ;)
     

  3. to hide this advert.

  4. 2009/04/24
    edmund085

    edmund085 Inactive Thread Starter

    Joined:
    2009/04/24
    Messages:
    4
    Likes Received:
    0
    i'm using windows xp service pack 2. And does the batch file commands is different from other versions?
     
  5. 2009/04/25
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Yes, XP does not contain DOS and has its own set of commands. Some are familiar and some are new.

    Go to Start > Help & Support > search Help for "Command line reference A-Z" (without the quotes).
     
  6. 2009/04/26
    wildfire

    wildfire Getting Old

    Joined:
    2008/04/21
    Messages:
    4,649
    Likes Received:
    124
    Hi Edmund,

    Did Tony's post help you or would you like further assistance?

    Please accept my apologies but sometimes real life is a pain in the backside ;)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.