#145265 - 2005-08-10 10:06 PM
Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
I am trying to get the below command to run ONLY once. It reboots the machine after running so it needs to not run every login. also it needs to detect Windwos XP pro SP2. if not sp2 it shoudl terminate. What I have so far does not work.
If Instr(@PRODUCTTYPE,"Windows XP Professional") If Instr(@CSD, "Service pack 2") SHELL '%comspec% /c "CPAU -u domain\username -p password -profile -ex "msiexec /i \\tahoe\packages\mmclientsp2.msi MASIP=192.168.5.40 /qn"' Endif Oh yeah it use CPAU to run as with admin rights.
|
Top
|
|
|
|
#145266 - 2005-08-10 10:40 PM
Re: Proper code to run command once
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
put an "if exist() ... endif" around it to see if the installed app exists, is the simplest method
|
Top
|
|
|
|
#145267 - 2005-08-10 11:05 PM
Re: Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
Not sure where that would fit in. this is a patch so the files to teh program are already there. I have changed it to this but it doesnt like the If Exists line. says somethign about Missing ) which is there so i dont get it. this shoudl say check windwos ver check SP versiona dn if the main progrma is installed. nto only does it error on me it will not check to see if the patch is installed.
IF EXIST(C:\Program Files\Avaya Modular Messaging\Client\vr.exe) If Instr(@PRODUCTTYPE,"Windows XP Professional") If instr(@CSD, "Service Pack 2") SHELL '%comspec% /c "CPAU -u sssnt\Install -p Install1 -profile -ex "msiexec /i \\tahoe\packages\mmclientsp2.msi MASIP=192.168.5.40 /qn"' Endif
|
Top
|
|
|
|
#145268 - 2005-08-10 11:11 PM
Re: Proper code to run command once
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
IF EXIST('C:\Program Files\Avaya Modular Messaging\Client\vr.exe')
if it is a patch, then yu will need to look in the reg to see if it makes a GUID in the add/remove program key.
Otherwise, you will need to make a tag file or reg value to see if it exists prior to install and then set it afterward
|
Top
|
|
|
|
#145269 - 2005-08-10 11:12 PM
Re: Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
got it with this
If Instr(@PRODUCTTYPE,"Windows XP Professional") If instr(@CSD, "Service Pack 2") IF EXIST("c:\Program Files\Avaya Modular Messaging\Client\vr.exe") SHELL '%comspec% /c "CPAU -u sssnt\Install -p Install1 -profile -ex "msiexec /i \\tahoe\packages\mmclientsp2.msi MASIP=192.168.5.40 /qn"' Endif
Now all i need is for it to only run once on each machine.
|
Top
|
|
|
|
#145270 - 2005-08-10 11:16 PM
Re: Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
how about if I copy the patch installer to the local machine, have it check if it is existing, and if not run if. hwo the hell would i write that.
|
Top
|
|
|
|
#145271 - 2005-08-10 11:22 PM
Re: Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
tried this and it says Else without IF After the Endif statement
If Exist("c:\MMClientSP2.exe") Endif Else If Instr(@PRODUCTTYPE,"Windows XP Professional") If instr(@CSD, "Service Pack 2") COPY "\\tahoe\packages\mmclientsp2.exe" "c:\" IF EXIST("c:\Program Files\Avaya Modular Messaging\Client\vr.exe") SHELL '%comspec% /c "CPAU -u sssnt\Install -p Install1 -profile -ex "msiexec /i \\tahoe\packages\mmclientsp2.msi MASIP=192.168.5.40 /qn"' Endif
|
Top
|
|
|
|
#145272 - 2005-08-10 11:42 PM
Re: Proper code to run command once
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Because your If/EndIf structure is wrong.
Here is maybe a better example, but not sure what you're really wanting.
Also, please post using the UBB Tags to preserve the formatting of your code.
Code:
If Exist("c:\MMClientSP2.exe") ;do nothing? Else If Instr(@PRODUCTTYPE,"Windows XP Professional") And instr(@CSD, "Service Pack 2") COPY "\\tahoe\packages\mmclientsp2.exe" "c:\" IF EXIST("c:\Program Files\Avaya Modular Messaging\Client\vr.exe") SHELL '%comspec% /c "CPAU -u sssnt\Install -p Install1 -profile -ex "msiexec /i \\tahoe\packages\mmclientsp2.msi MASIP=192.168.5.40 /qn"' EndIf Endif EndIf
|
Top
|
|
|
|
#145273 - 2005-08-10 11:46 PM
Re: Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
I am trying to get it to skip the bottom command if the file at the begining is there.
the line ;do nothign is my problem. if it finds file xx.exe it shoudl skip to the next set of commands and not install the patch. if i replace ;do nothing? with quit it quits the script adn doe snot run the rest. I want it to install a patch only if it is on windows xp pro with sp2 and only if it hasnt already been installed.
|
Top
|
|
|
|
#145275 - 2005-08-11 12:17 AM
Re: Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
yes by the file it copies to c. the first time it runs it check to see fi that file is on c. if it is not it copies it and runs the package. If it is there it should. end. actually your script above works perfectly. i have .exe instead of msi in teh file it looks for.
THANKS SO MUCH!!!
|
Top
|
|
|
|
#145276 - 2005-08-11 12:28 AM
Re: Proper code to run command once
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Quote:
Code:
If Exist("c:\MMClientSP2.exe") ;do nothing? Else
Simplify this to Code:
If Not Exist("c:\MMClientSP2.exe")
|
Top
|
|
|
|
#145278 - 2005-08-11 01:02 AM
Re: Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
I agree that is not the best way but is the easiest and quickest. I wouldn't know where to start as far as patch files. The initial program is easy as I can use it;s executable but the patch jsut updates files. what woudl i use to compare a file version?
|
Top
|
|
|
|
#145281 - 2005-08-11 01:25 AM
Re: Proper code to run command once
|
RonM
Fresh Scripter
Registered: 2004-10-11
Posts: 16
|
i just compared all the files and none are changed. may be stuck with what i have.
thanks fo ryour help btw.
|
Top
|
|
|
|
#145282 - 2005-08-11 01:39 AM
Re: Proper code to run command once
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Sorry but I find that difficult to believe that nothing changed.
Is this what you're installing or another update?
AVAYA MODULAR MESSAGING MM2.0 Service Pack 3 Release Notes
http://support.avaya.com/japple/css/japp...p;PAGE=Document
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 382 anonymous users online.
|
|
|