timbo343 Posted April 13, 2007 Posted April 13, 2007 Ive got this scrpit: 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
Joedetic Posted April 13, 2007 Posted April 13, 2007 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.
NetworkGeezer Posted April 13, 2007 Posted April 13, 2007 As you arer coding in VBS you can make use of the FileSystemObject as in this example from the MS scripting docs: ' 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 OutputFile.WriteLine (InstalledApplications(".")) rather than script echo. Alternatively why not just pipe the output to a file csript Installed_Software.vbs > OutputFile.Txt
srochford Posted April 13, 2007 Posted April 13, 2007 have a look at http://techinfo.cnwl.ac.uk/Computer%20Audit/default.asp?dest=Simple%20Software%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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now