Page 1 of 1

if else

Posted: 08 Jul 2014 19:30
by jmiller1225
I'm trying to write a script if a program isn't there then it would install the program. If the program is there it would open it up.. The problem I'm having is understanding the i f else statements

If c:/program/ABC.exe c:/program/ABC.exe
ELSE ABCinstall.exe

Re: if else

Posted: 08 Jul 2014 23:54
by foxidrive

Code: Select all

@echo off
if exist "c:\folder\file.exe" (
     start "" "c:\folder\file.exe"
 ) else (
     echo run installer
)