Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Easy question with IF ELSE

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61769
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Easy question with IF ELSE
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Easy question with IF ELSE - 6/24/2008 12:21:03 AM   
  kingskawn

 

Posts: 5
Score: 0
Joined: 6/24/2008
Status: offline
Hi all,

I'm trying, with a script, to uninstall office then install outlook and then uninstall language packs. This is what I have for now:


      

The problem is that I want to integrate an argument where it looks if the language pack NL and FR are installed or not and if they do not, go to the next command.

This is the order I want to achieve in the script

1. Look for Openoffice and if not installed, install (command -> msiexec /qb! /i openofficeorg21.msi ALLUSERS=1 SELECT_WORD=1 SELECT_EXCEL=1 SELECT_POWERPOINT=1) (command2 dictionnary-> msiexec /qb! /i SUN_OpenOffice21_Dico.msi)
2. Uninstall Office 2003
3. Uninstall language pack NL
4. Uninstall language pack FR
5. Install Outlook 2003

Thanks if anybody can help me!
 
 
Post #: 1
 
 RE: Easy question with IF ELSE - 6/24/2008 12:29:09 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
So the first thing to find out is if the language pack installs are MSIs or not.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kingskawn)
 
 
Post #: 2
 
 RE: Easy question with IF ELSE - 6/24/2008 12:41:31 AM   
  kingskawn

 

Posts: 5
Score: 0
Joined: 6/24/2008
Status: offline
Yes the 2 language packs are MSIs

The used string is {901E0413-6000-11D3-8CFE-0150048383C9} for NL and {901E040C-6000-11D3-8CFE-0150048383C9} for FR. Those must be uninstalled, not installed.

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Easy question with IF ELSE - 6/24/2008 1:03:46 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
Ok, so I would suggest looking into the WindowsInstaller.Installer object. You can use it's .ProductState method to determine what is or is not installed.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kingskawn)
 
 
Post #: 4
 
 RE: Easy question with IF ELSE - 6/24/2008 1:51:33 AM   
  kingskawn

 

Posts: 5
Score: 0
Joined: 6/24/2008
Status: offline
I made this. with the productstate method you said. but I'm not sure it's ok


      

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: Easy question with IF ELSE - 6/24/2008 1:53:15 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
Well, does it do what you want? Have you tested it? Do you get errors? 

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kingskawn)
 
 
Post #: 6
 
 RE: Easy question with IF ELSE - 6/24/2008 2:43:36 AM   
  kingskawn

 

Posts: 5
Score: 0
Joined: 6/24/2008
Status: offline
I've got an error on line 28

(in reply to ebgreen)
 
 
Post #: 7
 
 RE: Easy question with IF ELSE - 6/24/2008 3:02:39 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
Get rid of the extra then on the line by itself. Then is a keyword that is only valid on the same line as an If keyword.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kingskawn)
 
 
Post #: 8
 
 RE: Easy question with IF ELSE - 6/24/2008 3:09:10 AM   
  kingskawn

 

Posts: 5
Score: 0
Joined: 6/24/2008
Status: offline
but I want to execute those 2 commands

objShell.Run LangNl, 0, True
and
objShell.Run LangFr, 0, True

but not at the same time

(in reply to ebgreen)
 
 
Post #: 9
 
 RE: Easy question with IF ELSE - 6/24/2008 3:11:19 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
Just put them each on their own line and they will execute sequentially.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kingskawn)
 
 
Post #: 10
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Easy question with IF ELSE Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts