Networking Forums

Networking Forums > Computer Networking > Windows Networking > logon script logic

Reply
Thread Tools Display Modes

logon script logic

 
 
Fredly
Guest
Posts: n/a

 
      04-06-2005, 08:46 PM
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...



 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a

 
      04-06-2005, 09:28 PM

"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"


 
Reply With Quote
 
Fredly
Guest
Posts: n/a

 
      04-07-2005, 03:00 PM
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"
>
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a

 
      04-07-2005, 09:51 PM
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"
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
logon script for gpo Joe Windows Networking 1 10-04-2004 05:51 PM
GP logon script Stuart Jeffrey Windows Networking 1 09-12-2004 08:31 PM
Logon script =?Utf-8?B?RGF2ZQ==?= Windows Networking 4 04-22-2004 11:56 PM
Logon script Alan Crawford Windows Networking 0 12-26-2003 10:45 PM
Logon Script Kat Windows Networking 2 10-07-2003 10:01 PM



1 2 3 4 5 6 7 8 9 10 11