+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, Find out what software is installed on a pc script in Coding and Web Development; Ive got this scrpit: Code: WScript.Echo InstalledApplications(".") Function InstalledApplications(node) Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE Set oRegistry = GetObject("winmgmts://" _ & ...
  1. #1
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,159
    Thank Post
    319
    Thanked 311 Times in 217 Posts
    Rep Power
    124

    Find out what software is installed on a pc script

    Ive got this scrpit:

    Code:
    WScript.Echo InstalledApplications(".")
    
    Function InstalledApplications(node)
     Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
     Set oRegistry = GetObject("winmgmts://" _
      & node & "/root/default:StdRegProv")
     sBaseKey = _
      "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
     iRC = oRegistry.EnumKey(HKLM, sBaseKey, arSubKeys)
    
     For Each sKey In arSubKeys
    
      iRC = oRegistry.GetStringValue( _
       HKLM, sBaseKey & sKey, "DisplayName", sValue)
      If iRC <> 0 Then
       oRegistry.GetStringValue _
        HKLM, sBaseKey & sKey, "QuietDisplayName", sValue
      End If
      If sValue <> "" Then
       InstalledApplications = _
        InstalledApplications & sValue & vbCrLf
      End If
     Next
    
    End Function
    it shows the user what software is installed on the local machine, but im wanting to output it to a text file

    Can someone tell me how to do it please

    Thanks

    T

  2. #2
    Joedetic's Avatar
    Join Date
    Jan 2006
    Location
    Walsall
    Posts
    1,316
    Thank Post
    6
    Thanked 13 Times in 13 Posts
    Rep Power
    22

    Re: Find out what software is installed on a pc script

    If it were C i could have a stab at saying something to do with

    FILE *out;

    fopen(some stuffs i'd need to look up);
    fprintf(some more stuffs i'd need to look up);
    fclosef(yet more stuffs i'd need to look up);

    Have a look on t'internet for streams.

    If it's just for running occassionally on one machine try http://www.belarc.com

    It'll list all your machine specs, all the software, all the windows patches etc etc into a local HTML file.

    Very useful.

  3. #3

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Find out what software is installed on a pc script

    As you arer coding in VBS you can make use of the FileSystemObject as in this example from the MS scripting docs:

    Code:
    ' VBScript
    Dim fso, MyFile
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set MyFile = fso.CreateTextFile("c:\testfile.txt", True)
    MyFile.WriteLine("This is a test.")
    MyFile.Close
    In your script you would use something like
    Code:
    OutputFile.WriteLine (InstalledApplications("."))
    rather than script echo.

    Alternatively why not just pipe the output to a file
    Code:
     csript Installed_Software.vbs > OutputFile.Txt

  4. #4

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,158
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124

    Re: Find out what software is installed on a pc script

    have a look at http://techinfo.cnwl.ac.uk/Computer%...re%20Audit.htm

    I've just realised that I never finished that set of web pages but this will hopefully point you in the right direction.



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 31
    Last Post: 2nd November 2007, 06:20 PM
  2. Deploy software (K-Lite) via a .bat script
    By OverWorked in forum How do you do....it?
    Replies: 2
    Last Post: 21st September 2006, 01:59 PM
  3. ok got irm installed
    By russdev in forum Web Development
    Replies: 0
    Last Post: 6th March 2006, 10:17 AM
  4. USB drives on RIS installed machines
    By ChrisH in forum Hardware
    Replies: 3
    Last Post: 14th February 2006, 12:19 PM
  5. vista beta anyone got it installed yet?
    By russdev in forum Windows
    Replies: 16
    Last Post: 15th August 2005, 05:46 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •