deploying a custom msi file using sccm

we have a custom mis file to upgrade the citrix ica client. we want to make sure the client processes are not running when the upgrade starts so we want to kill the processes. we tried using a batch file but straight forward commands like xcopy and .msi are  not running. i want to be able to do the followinf

kill 3 processes. i was trying to copy a tool called pskill on the local client called a windows batch file but it is not copying the files.

secondly i want to display a message to the users that an upgrade is going on and asking then not to open the client process for some time

thirdly i want to run the msi. i must kill the processes if not the upgrade will fail. the message also is important. need help.

mgmohiuddinAsked:
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.

merowingerCommented:
I've attached a VBscript which should be saved *.vbs. You have execute this Script as command in your sccm program command line (best with: wscript.exe install.vbs). The script will kill processA, processB and processC and then will execute the .msi. Please just customize for your needs.
The message for the user, that a upgrade is in progress cannot be dont from within the script, as the command is executed in "local system" user context. So all message will never be visible for the logged on users.
SCCM delivers the possibiliy to display a message during installation, so why don't you use this one?
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2") 
Set objShell = CreateObject("Wscript.Shell")


KillProcess("'processA.exe'")
KillProcess("'processB.exe'")
KillProcess("'processC.exe'")

strMSI = "MSI2Execute.msi"

On Error Resume Next
objShell.Run objShell.ExpandEnvironmentStrings("%WINDIR%") &"\System32\msiexec /I " &strMSI &" /qb-!",1,true
On Error Goto 0

Sub KillProcess(strProcess)
On Error Resume Next
Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = " & strProcess)
For Each objProcess in colProcess
	objProcess.Terminate()
Next 
On Error Goto 0
End Sub

Open in new window

0

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 Server OS

From novice to tech pro — start learning today.