General discussion

Locked

Help w/ batch file for SMS 2003

By rotartsinimdA ·
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!

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by bart777 In reply to Help w/ batch file for SM ...

In this case I think I would use a scripting language like Kix32. It has no problem checking for files, registry keys, etc...

Take a look. www.kixtart.org

Collapse -

by dmcelhiney In reply to Help w/ batch file for SM ...

To detect the OS, I take advantage of the fact that different OS's have different environment vars set. Sometimes I use the VER command and FIND command.

"OS"="Windows_NT" on any NT or higher box.
"ProgramFiles" is set on 2000 or higher

IF NOT "%OS%"=="Windows_NT" ECHO This is 95/98/me

IF "%OS%"=="Windows_NT" ECHO This is NT4/2000/XP/2003

IF "%OS%"=="Windows_NT IF "%ProgramFiles%"=="" ECHO This is NT4

IF "%OS%"=="Windows_NT IF NOT "%ProgramFiles%"=="" ECHO This is 2000 or higher

I am not familair with SMS client, but since it is a Microsoft product, I assume it has an .MSI based install? Try this: (QB! = only show a progress bar and disable the cancel button)

MSIEXEC.EXE /I /QB! SMSClient.MSI
or
SETUP.EXE /QB!

To see if an app is already installed, I usually look for it's EXE, but this has problems if you don't know where it's installed (e.g. the user ran setup and changed the installation folder to or something)

IF EXIST "C:\Program Files\SMS Client\SMSClient.EXE" ECHO Looks like it's installed.

Also use the FIND command and check the return code to see inside files. If FIND returns 0 the text was found.

VER > "%TEMP%\OSVER.TXT"
FIND "Microsoft Windows XP" "%TEMP%\OSVER.TXT"
IF "%ERRORLEVEL%"=="0" ECHO This is XP
IF NOT "%ERRORLEVEL%"=="0" ECHO This NOT XP
DEL "%TEMP%\OSVER.TXT"

Collapse -

by Paulvs1_ In reply to Help w/ batch file for SM ...

To detect the OS, I take advantage of the fact that different OS's have different environment vars set. Sometimes I use the VER command and FIND command.

"OS"="Windows_NT" on any NT or higher box.
"ProgramFiles" is set on 2000 or higher

IF NOT "%OS%"=="Windows_NT" ECHO This is 95/98/me

IF "%OS%"=="Windows_NT" ECHO This is NT4/2000/XP/2003

IF "%OS%"=="Windows_NT IF "%ProgramFiles%"=="" ECHO This is NT4

IF "%OS%"=="Windows_NT IF NOT "%ProgramFiles%"=="" ECHO This is 2000 or higher

I am not familair with SMS client, but since it is a Microsoft product, I assume it has an .MSI based install? Try this: (QB! = only show a progress bar and disable the cancel button)

MSIEXEC.EXE /I /QB! SMSClient.MSI
or
SETUP.EXE /QB!

To see if an app is already installed, I usually look for it's EXE, but this has problems if you don't know where it's installed (e.g. the user ran setup and changed the installation folder to or something)

Back to Security Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums