Discussion Locked

Help w/ batch file for SMS 2003

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi. I have an exisiting batch file that would determine if what OS is on the client then it would would either install the SMS Advance Client or Legacy Client, (also DSclient if OS is not W2K). Need help on constructing a batch that would detect if an SMS client is installed or not.

Also, does anybody know how to install the SMS Advance client, Legacy client & DSclient w/o human intervention?

Thanks in advance!

4 replies

by shawn

You could use a .VBS file and Windows Scripting Host (WSH) to search through the registry for an entry for the SMS client. For example:

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

Copy and paste this text, and save it as a .VBS file. When it runs, it will show you what applications are installed on the system. Then you can incorporate this into a larger script that would save the results of the function into a variable and you could search through to see if the SMS client was listed.

Hope this helps.

Cheers,
Shawn

by rotartsinimda

Hi Shawn,

Thanks for the reply. Actually, I decided to make use of the command IF Exist in my batch file and it looks for an existing file of the SMS client installation such as the ccm.exe.

Thanks for taking time on this matter.

-Gadel

This discussion is closed to new replies.