Link to home
Start Free TrialLog in
Avatar of ampapa
ampapa

asked on

Windows Scripting to remove and install applications

Does anyone have a script or two that I can look at that will add or remove an application from the computer? Can this be done with WSH? or do I need to go another route?


Thanks,
SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You may not need a script at all.

In windows XP, from a Command Prompt type "msiexec /?", this will give you all of the command line options for installing an application using msiexec.exe from a command propmt.

In WIndows 2000 and/or XP, go to help and search for MSIEXEC, review the command line options and instructions on how to use it.

The program MSIEXEC, is the Microsoft Installer, it is used by almost every software install. This program can use command line options to install almost any application, any way you want.

J
Avatar of ampapa

ASKER

Debsyl99,

Thanks for the script but my Application is not showing up as an item so I assume that it is unable to assist in the removal?

This application doesn't have an .MSI file so I think MSIEXEC is also out of the question.

In order for the application to show up in the add/remove programs, it must use the msiexec mechanism. If the program uses a different type of installation packaging then most "typical" scenarios will not work. Do you know how the application is packaged?

J
Avatar of ampapa

ASKER

It does show up in the add remove programs.

I tried from a Command Prompt typing "msiexec /?" and I get an error "incorrect command line parameters"?

Is VBScript an option? I'm guessing that any of the scripting routines might help?
Then you are on Windows 2000, correct? The 2000 version does not have the /? switch. Goto Start, Help, select "Search", type in MSIEXEC. The instructions and command line parameters are in the Windows 2000 Help Files. If the program does not have an MSI, take a look here, http://www.installsite.org/pages/en/msi/authoring.htm ... you can probably create one.

With that said, this is probably the real solution. Below are the instructions to configure a ZAP installation, for Group Policy installs. These can be published to the users through Active Directory.

How do I publish non-MSI programs?

Non-MSI (Microsoft Installer) programs use their own Setup programs. These programs:

. Can be published to users only.

. Can NOT use elevated installation privileges.

. Can NOT be installed on the first use of the application.

. Can NOT install a feature on the first use.

. Can NOT roll back an unsuccessful operation.

. Can NOT use other MSI features.

To publish a non-MSI program:

1. Create a .zap file, using the following sample:

[Application]
; Only FriendlyName and SetupCommand are required,
; everything else is optional.

; FriendlyName is the name of the program that
; will appear in the software installation snap-in
; and the Add/Remove Programs tool.
; REQUIRED
FriendlyName = "Microsoft Excel 97"

; SetupCommand is the command line used to
; Run the program's Setup. If it is a relative
; path, it is assumed to be relative to the
; location of the .zap file.
; Long file name paths need to be quoted. For example:
; SetupCommand = "long folder\setup.exe" /unattend
; or
; SetupCommand = "\\server\share\long _
; folder\setup.exe" /unattend
; REQUIRED

SetupCommand = "setup.exe"

; Version of the program that will appear
; in the software installation snap-in and the
; Add/Remove Programs tool.
; OPTIONAL
DisplayVersion = 8.0

; Version of the program that will appear
; in the software installation snap-in and the
; Add/Remove Programs tool.
; OPTIONAL
Publisher = Microsoft
2. To publish the program, use the Default Domain (or Local) Group Policy and navigate to User Configuration / Software Settings / Software Installation.
3. Right-click Software Installation and press New.

4. Press Package.

5. Toggle Files of type to ZAW Down-level applications package (*.zap).  

6. Navigate to and select the .zap file and press Open.

7. Press Publish.

8. Press OK.
Avatar of ampapa

ASKER

"Group Policy installs" I'm unaware of how that works?

I was hoping more for a shortcut/batch/script to the uninstall and install routines associated with an Application. How can I shorten the mouse clicks need to remove an application and install an application?

MSIEXEC would be the way to go if I were pushing this out on the network for sure but I'm only talking about a couple of computers and the learning curve on using MSIEXEC seems steep.

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi

Thanks for the assist but unless you had an msi file (and sadly you didn't) I didn't assist - seriously you should have left this open longer!

I'm on my weekend here (uk time) and was planning on picking this up again on Monday.  Sorry I wasn't more help,

Best wishes

Deb :))

(Oh and JD - great to see you're a clean-up volunteer now! But how on earth do you find the time??? - D ;))

Told you, I am bored... I put in my notice to leave my current position and for political reasons, they had requested a 6 week transition. So, I don't start at my new job until October 8, and I have nothing to do at this one :)
J
Well that's EE's gain - if you ever have need of any enthusiastic net admins, female and with entertaining British accents - let me know eh? ;)
Ha... are you cute? (SO politically incorrect! but hey, I am a world away)... I am tired of looking at 40 yr old techno geeks!

J
Avatar of ampapa

ASKER

Well jdeclue made a good point that essentially it was as easy as pushing a few buttons... I'm lazy but not stupid... At least I don't think I am, stupid that is.

I decided to use the registry's uninstall information and create a batch file crude but it will work except for answering the YES/NO questions? Any ideas?

p.s. I love the British! 40 isn't that old unless your 18...