Your way of coding will work nicely in a batch file that
is executed as part of the logon process. However, it
has the drawback of closing an existing Command Prompt
window during testing. Here are a couple of alternatives
that get around this problem:
Option 1:
IF EXIST path goto :eof
path\install.msi
Option 2:
IF EXIST path exit /b
path\install.msi
"Fredly" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In case it helps someone:
>
> I ended up doing :
>
> IF EXIST path EXIT
> path\install.msi
>
> It has to go at the end of the script...
>
> "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
> news:u2GBn#(E-Mail Removed)...
> >
> > "Fredly" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > I'm trying to call an MSI package from my logon script.
> > >
> > > I only want it to run if a folder doesn't already exist.
> > >
> > > Can I run a line like
> > >
> > > if not exists "path"
> > >
> > > then
> > >
> > > run "path\file.msi"
> > >
> > > end if
> > >
> > > I'm sure I butchered that. Any help would be appreciated...
> >
> > Try this:
> >
> > @echo off
> > if exist "path\file.msi" "%SystemRoot%\System32\msiexec.exe"
> > "path\file.msi"
> >
> >
>
>
|