In some scenarios you need to install the SCCM client using another Software Distribution tool than Configuration Manager, yes I know it sounds strange 😉
If you have tried this you know that the Ccmsetup.exe installs a service and the exits in the user context so that control is returned to the vbscript, cmd file or whatever method you use to run Ccmsetup.
There are two ways of solving this:
1. Run Ccmsetup.exe with the /noservice switch then ccmsetup runs the setup in the user with which you triggered the installation and not using a service in System context.
2.Use vbscript that checks for an active process called “ccmsetup.exe” and wait for it to exit.
I thought of writing a script for this and then I found this excellent discussion on a forum: http://www.tek-tips.com/viewthread.cfm?qid=911251
That script will work for Ccmsetup as well. Below is the modified script for ccmsetup.exe
Set WshShell = Nothing
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "ccmsetup.exe SMSSITECODE=020 FSP=SCCM01", 0, True
Wscript.Sleep 5000
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='ccmsetup.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Do While iniproc = 1
wscript.sleep 5000
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='ccmsetup.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Loop
set cproc=nothing
set svc=nothing
Set WshShell = Nothing
You forgot to delete the “objShell.Run” in line 3 of the script.
thanks for the heads-up :$
/jörgen
Please, post the full, corrected, script.
Hi,
I have updated about a week ago.
ccmsetup.exe must be in the same directory as the script and run with cscript.
/jörgen
How do i fix the script to specify the side code as a variable instead of hard coding the variable or other switches as a variable.
Could you provide script for uninstalling SCCM 2007 client. Thanks!