determine windows and ms office versions with script and email results.

I need to perform a basic software audit on over 300 pc's and don't want to burden the users with software installed or convoluted procedures.
I need to know the MS Windows version (and architecture if possible), the MS Office version and if possible, the highest DotNetFramework version installed.

I was thinking a script might be able to do this...   but I'd like the output of the query emailed to me or displayed in a text file that the user can copy/paste into an email to send to me.

A few google searches suggest I could use for example:
reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v "ProductName"

Open in new window

reg query "HKEY_CLASSES_ROOT\Word.Application\CurVer"

Open in new window

but I don't know how to output the results into a usable format.

Is there any suggestions for scripts or small programs that could do what I need?

There is this one executable (attached as a zip that you will need to decompress and change the extension of the file inside back to an exe) that is perfect, but I can't use it because it's for a proprietary software install and contains hyperlinks, logos and company names that I don't want plastered all over the place.
Reece DoddsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

To output in a usuable format, you can do something like

reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v "ProductName" > c:\temp\%computername%.txt

reg query "HKEY_CLASSES_ROOT\Word.Application\CurVer" >> c:\temp\%computername%.txt

who put the result in c:\temp\hostname.txt

Then, you can copy it in a shared folder or send it per mail with a DOS program called sendmail...
Reece DoddsAuthor Commented:
Thanks for the suggestion.

I'm trying the following as a batch file using BLAT to send the mail:

Set SoftwareVersions=C:\%computername%.txt
Set EmailLogFile=C:\Email-Log.txt
set EmailSubject=%~nx0: Software Test Results
REM Optional; leave empty if the user running the task can send directly to the smtp server:
set EmailUser=ithelpdesk
REM Because of passwords potentially containing characters with special meaning in batch,
REM the password string *has* to be enclosed in double quotes when setting the variable!
set EmailPass="MyPassword132!"

reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v "ProductName" > %SoftwareVersions%
reg query "HKEY_CLASSES_ROOT\Word.Application\CurVer" >> %SoftwareVersions%

if "%EmailUser%"=="" (
	set LogonOption=
) else (
	set LogonOption= -u "%EmailUser%" -pw %EmailPass%
"" %SoftwareVersions% -server %EmailServer% -f %EmailFrom% -t %EmailTo% -s "%EmailSubject%" %LogonOption% >"%EmailLogFile%" 2>&1

Open in new window

But I'm getting the message "The filename, directory name, or volume label syntax is incorrect." in the email log file that is created.

Where am I going wrong?
I've tried with success with :


Set SoftwareVersions=C:\%computername%.txt

reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v "ProductName" > %SoftwareVersions%
reg query "HKEY_CLASSES_ROOT\Word.Application\CurVer" >> %SoftwareVersions%

\\server\share\mailsend.exe -smtp MAILSERVER -d DOMAIN -t EMAILTO +bc -f EMAILFROM -sub "MAIL SUBJECT" -attach "%SoftwareVersions%,text/plain,i" -M "SEE ATTACHED DOC"

The mailsend program can be downloaded here, it's a single .exe file :

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.