Page 1 of 1 1
Topic Options
#190700 - 2008-11-20 06:31 PM Batch file issue
sameer Offline
Fresh Scripter

Registered: 2008-11-20
Posts: 7
Hello.

I have read the forums and a complete newbie to kix scripting. I am calling a batch file from a UNC path and the batch file as shown below

Batch File

@echo off
if exist %windir%\off07.txt goto end

\\cadmfs01\support\install\applications\microsoft\office2k7\setup.exe /adminfile CGY_2007off.MSP

copy \\cadmfs01\support\install\applications\microsoft\office2k7\off07.txt %windir% >NUL
:End

KIX SCRIPT

IF INGROUP ("Domain Admins")
RUN "\\cadmfs01\support\install\Applications\Microsoft\Office2k7\CGYOff2007Install_new.bat"
GOSUB DisplayError

ENDIF

When the user logs in nothing happens. When I run this batch file from the command line it launches with no issues. Can somebody please help.

Thanks,

Top
#190702 - 2008-11-20 06:51 PM Re: Batch file issue [Re: sameer]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
It may have something to do with using run instead of shell.

Why bother with the batch though...

untested
 Code:
IF INGROUP ("Domain Admins")
  shell "\\cadmfs01\support\install\applications\microsoft\office2k7\setup.exe /adminfile CGY_2007off.MSP"
  copy "\\cadmfs01\support\install\applications\microsoft\office2k7\off07.txt" "%windir%"
  ? @serror
ENDIF
_________________________
(... better days ahead)

Top
#190703 - 2008-11-20 07:38 PM Re: Batch file issue [Re: Allen]
sameer Offline
Fresh Scripter

Registered: 2008-11-20
Posts: 7
Thanks Allen,

But I need that initial check for that off07.txt file or else the setup will start installing when the user logs in the 2nd time :).

Thanks,

Sameer

Top
#190705 - 2008-11-20 08:26 PM Re: Batch file issue [Re: sameer]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
You can make that check in Kix as well.

 Code:
IF INGROUP ("Domain Admins")
  If Not exist (%windir% + "\off07.txt")
    shell "\\cadmfs01\support\install\applications\microsoft\office2k7\setup.exe /adminfile CGY_2007off.MSP"
    copy "\\cadmfs01\support\install\applications\microsoft\office2k7\off07.txt" "%windir%"
    ? @serror
  EndIf
ENDIF
_________________________
Today is the tomorrow you worried about yesterday.

Top
#190715 - 2008-11-21 04:43 PM Re: Batch file issue [Re: Gargoyle]
sameer Offline
Fresh Scripter

Registered: 2008-11-20
Posts: 7
Guys,

Thanks for all you replies. Gargoyle your script works awesome but i am stuck at one more hump. I need to check for this file %systemroot%\system32\LLSSRV.EXE before installing office. If this file exists then exit the install and if it is not present then check for the off07.txt file and then continue the install.

Thanks for all the help

Top
#190716 - 2008-11-21 06:41 PM Re: Batch file issue [Re: sameer]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Is this inclusive or exclusive of the off07.txt file?

 Code:
If NOT exist (%windir% + "\off07.txt") AND NOT exist (%systemroot% + "\system32\LLSSRV.EXE)

or
 Code:
If NOT exist (%Systemroot% + "\system32\llssrv.exe")
  If NOT exist (%WinDir% + "\off07.txt")
_________________________
Today is the tomorrow you worried about yesterday.

Top
#190717 - 2008-11-21 06:44 PM Re: Batch file issue [Re: Gargoyle]
sameer Offline
Fresh Scripter

Registered: 2008-11-20
Posts: 7
Hi Gargoyle

I need the 1st check of the script to be for (%systemroot% + "\system32\LLSSRV.EXE) this file. If this exists then I know that I need to skip installing office 2007 and exit. If (%systemroot% + "\system32\LLSSRV.EXE) it does not exist then check for off07.txt. If LLSSRV.exe is not present but off07.txt is present then I know that office 2007 has been installed on this machine even when LLSSRV.exe is not present because off07.txt file is present. I hope i made sense.

Top
#190718 - 2008-11-21 06:51 PM Re: Batch file issue [Re: sameer]
sameer Offline
Fresh Scripter

Registered: 2008-11-20
Posts: 7
Just to clarify again steps of the script are:

Check for LLSSRV.exe
If exist - skip install and exit..dont check for off07.txt exit completely
If not exist - Check for off07.txt
If off07.txt exists then skip install and exit
If off07.txt not exist - start the install
After install copy off07.txt to %windir%

Top
#190719 - 2008-11-21 07:06 PM Re: Batch file issue [Re: sameer]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
 Code:
IF INGROUP ("Domain Admins")
  If NOT exist (%Systemroot% + "\system32\llssrv.exe")
    If Not exist (%windir% + "\off07.txt")
      shell "\\cadmfs01\support\install\applications\microsoft\office2k7\setup.exe /adminfile CGY_2007off.MSP"
      copy "\\cadmfs01\support\install\applications\microsoft\office2k7\off07.txt" "%windir%"
    ? @serror
    EndIf
  ENDIF
EndIf
_________________________
Today is the tomorrow you worried about yesterday.

Top
#190720 - 2008-11-21 07:42 PM Re: Batch file issue [Re: Gargoyle]
sameer Offline
Fresh Scripter

Registered: 2008-11-20
Posts: 7
thanks... will let you know how it goes
Top
#190746 - 2008-11-24 10:15 PM Re: Batch file issue [Re: sameer]
sameer Offline
Fresh Scripter

Registered: 2008-11-20
Posts: 7
Gargoyle,
That script worked wonders.... thanks so much for your help.

Top
#190749 - 2008-11-25 01:31 AM Re: Batch file issue [Re: sameer]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Glad to hear.
_________________________
Today is the tomorrow you worried about yesterday.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 857 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.062 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org