#45430 - 2003-09-08 12:31 AM
Windows Add Remove Programs
|
Johan van Huyssteen_dup1
Fresh Scripter
Registered: 2003-08-28
Posts: 22
Loc: RSA
|
[Moderator (Sealeopard): Moved topic from 'Scripts' to 'Starters' forum due to lack of script in body]
I need a Solution that will give me a list of add remove programs from windows 9x,me,nt,2000 and Xp. It must be inserted to os.ini and numbered eg.
1. microsoft office 97 2. fluke lan meter 3. winzip 8.1 [ 17. September 2003, 20:32: Message edited by: sealeopard ]
|
|
Top
|
|
|
|
#45433 - 2003-09-07 01:07 PM
Re: Windows Add Remove Programs
|
Johan van Huyssteen_dup1
Fresh Scripter
Registered: 2003-08-28
Posts: 22
Loc: RSA
|
Do you have a script to enumerate the reg uninstall string a know it will work in all versions of windows.
|
|
Top
|
|
|
|
#45435 - 2003-09-07 01:58 PM
Re: Windows Add Remove Programs
|
Johan van Huyssteen_dup1
Fresh Scripter
Registered: 2003-08-28
Posts: 22
Loc: RSA
|
Thanks I will search for it !!
|
|
Top
|
|
|
|
#45436 - 2003-09-07 10:37 PM
Re: Windows Add Remove Programs
|
kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Johan
You can use the following to enumerate the uninstall info, this will create: ProgInfo.ini
An ini-file containing the uninstall string for all software installed (Known by Windows) Can be used on Win95 - XP
If your inifile contains enties like: {00170806-79E1-11D8-E60F-006097A988F7}
These are applications that are installed using the windows installer. You should use the windows installer to uninstall these application.
If the application dosn't contain a QuietUninstallString, you can try adding the parameters: -a /a -s /s -u /u
To the UninstallString, try them out, one by one to see if any of them works.
code:
$WsInfoFile = %TEMP% + '\ProgInfo.ini' $RootKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" $Index = 0 $Key = EnumKey($RootKey,$Index) While @Error = 0 $RC = EnumValue($RootKey + $Key,1) If @Error = 0 $Value = ReadValue($RootKey + $Key,"QuietUninstallString") If $Value = "" $Value = ReadValue($RootKey + $Key,"UninstallString") If $Value = "" $Value = $Key EndIf EndIf $RC = WriteProfileString($WsInfoFile,"UnInstInfo",$Key,$Value) EndIf $Index = $Index + 1 $Key = EnumKey($RootKey,$Index) Loop
-Erik
|
|
Top
|
|
|
|
#45437 - 2003-09-11 03:34 PM
Re: Windows Add Remove Programs
|
Johan van Huyssteen_dup1
Fresh Scripter
Registered: 2003-08-28
Posts: 22
Loc: RSA
|
Thanks
I will testand update you....
|
|
Top
|
|
|
|
#45438 - 2003-09-11 03:44 PM
Re: Windows Add Remove Programs
|
Johan van Huyssteen_dup1
Fresh Scripter
Registered: 2003-08-28
Posts: 22
Loc: RSA
|
Kholm.
I need a script that will tell me what is in add remove programs and pype it to an ini file, can you assist please...........
|
|
Top
|
|
|
|
#45440 - 2003-09-11 04:34 PM
Re: Windows Add Remove Programs
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
You may need to add some switches.. While Enumerating the uninstall key in the registry is fine, you may want to uninstall a program quietly..
Here is an example -
code:
IF KEYEXIST('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2DFE1608-BDCA-11D1-B7AE-00C04FB92F3D}') RUN 'MsiExec.exe /qn /x{2DFE1608-BDCA-11D1-B7AE-00C04FB92F3D}' $mailhost = 'smtp.company.com' $recipient = 'admin@@company.com' $sender = @userid+'@@company.com' $mailLine = @ldrive+'Programs\blat.exe - -to $recipient -server $mailhost -subject "MS Project removed!!" ' $mailLine = $mailLine+'-body "MS Project has been removed for - @userid (@fullname)" -f $sender -q' SHELL $mailLine ENDIF
The following resource may be helpful for the MSIEXEC (.MSI) installer - Command-Line Switches for the Microsoft Windows Installer Tool
Kent
|
|
Top
|
|
|
|
#45441 - 2003-09-11 07:06 PM
Re: Windows Add Remove Programs
|
Johan van Huyssteen_dup1
Fresh Scripter
Registered: 2003-08-28
Posts: 22
Loc: RSA
|
It doesn't work!!!!
|
|
Top
|
|
|
|
#45442 - 2003-09-11 07:12 PM
Re: Windows Add Remove Programs
|
Johan van Huyssteen_dup1
Fresh Scripter
Registered: 2003-08-28
Posts: 22
Loc: RSA
|
Sorry its working it was in the temp in my profile path "C:\DOCUME~1\JohanVh\LOCALS~1\Temp" I will tweak it to a other path. Thanks again...
|
|
Top
|
|
|
|
#45444 - 2003-09-16 03:05 PM
Re: Windows Add Remove Programs
|
Richie19Rich77
Seasoned Scripter
   
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
This function will list all installed programs, needs Functions ASort and GetSoftwareList.
Example Code
code:
Call "\\fps\admin\kix\functions\Asort().kix" Call "\\fps\admin\kix\functions\GetSoftwareList().kix"
? "Please Type in the PC name you wish to check: "Gets$Computer
$InstalledSoftwareArray=GetSoftwareList($Computer,1) For Each $Object in $InstalledSoftwareArray ? $Object Next
GetSoftwareList() Function
code:
Function GetSoftwareList(OPTIONAL $Computer,OPTIONAL $Sort) Dim $ArrayIndex, $EnumIndex, $Component, $DN, $RegKey, $SwArray[200] If $Computer $RegKey='\\'+$Computer+'\HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall' Else $RegKey='\HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall' EndIf $EnumIndex=0 $ArrayIndex=0 :gisloop $Component=EnumKey($RegKey, $EnumIndex) If NOT @Error If NOT (Len($Component)=7 AND Left($Component,1)='Q') ; above line excludes hotfixes from listing If NOT (0+ReadValue($RegKey+'\'+$Component,'SystemComponent')) $DN=ReadValue($RegKey+'\'+$Component,'DisplayName') If $DN $SwArray[$ArrayIndex]=$DN $ArrayIndex=$ArrayIndex+1 EndIf EndIf EndIf $EnumIndex=$EnumIndex+1 GoTo gisloop EndIf ReDim preserve $SwArray[$ArrayIndex] If $Sort $GetSoftwareList=Asort($SwArray) Else $GetSoftwareList=$SwArray EndIf EndFunction
This code was developed by ScriptLogic.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|