Help running an application - Script never runs

Hello, I have an unusual problem with a SCCM 2012 Application we are trying to get working correctly. It's a very simple application in SCCM with the content for this application being a created vbs file. The created vbs file just calls a vendor supplied uninstall vbs file that removes an application from the server.  The goal is to roll this to all of our servers so that we cab uninstall the vendor application from the server.

SCCM is correctly rolling the content to the servers in the CCMcache folder.  I can even look in the execmgr.log and Ccm32bitLauncher.log on the client and see the vbs script being launched with a process ID on the server.  This in turn launches the vendor supplied uninstall script by design, which SCCM logs as running with return = 0 (completed execution).  Trouble is, this script fails to launch the MSI for the uninstall on the 2008 server.

Here is the fun part: 
-The SCCM Application works fine and the server application uninstalls with windows 2003, but fails on windows 2008 R2. 
-Additionally, if I log into the 2008 server and cscript launch our created vbs script (which triggers the vender supplied script, it works just fine and uninstalls the vendor app.
-To troubleshoot permissions, I even opened a command prompt using PSEXEC on the 2008 servers with the local system account (same account SCCM uses for running applications), and issued a cscript command to our created vbs file.  Our created script triggers the vendor app uninstall script.  The vendor uninstall script remove the app just fine.  (Even when I issue the cscript command from the ccmcache folder). 

So the question is: Why is our SCCM Application working on 2003 servers and NOT on 2008 R2 servers?

If you could help me out, it would be appreciated.  Thank you.

February 7th, 2014 4:00pm

32-bit vs. 64-bit os perhaps? Could you post your scripts here, without them its really hard to help..
Free Windows Admin Tool Kit Click here and download it now
February 7th, 2014 4:51pm

Can you install the application via the vbs script manually on the R2 server without deploying via SCCM? i.e. is this a application/architecture issue or a deployment is
February 7th, 2014 5:40pm

Without knowing the substance of the script, there's not much anyone can actually say but my first guess is the same as narcotocoo's -- what you are doing in the script is being redirected because it is running in the 32-bit cscript on a 64-bit system.

to handle this in a program, execute cscript from %windir%\sysnative.

Free Windows Admin Tool Kit Click here and download it now
February 8th, 2014 10:41pm

Here is the script we created and that get pushed out to each server in the SCCM package.  The ops_inst.vbs is a fairly large script that was written by HP and comes with the product.  Our script just calls opc_inst.vbs and applies a -remove to the end of it.

Set oFSO = CreateObject("Scripting.FileSystemObject")

If oFSO.FileExists("C:\windows\temp\opc_inst.lock") Then
 oFSO.DeleteFile("C:\windows\temp\opc_inst.lock")
End If

Set oShell = CreateObject("WScript.Shell")
Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colServiceList = oWMIService.ExecQuery("Select * from Win32_Service where Name='OvCtrl'")

s2003Command1 = "C:\Documents and Settings\All Users\Application Data\HP\HP BTO Software\installation\bundles\Operations-agent\opc_inst.vbs"
s2003Command2 = "W:\Documents and Settings\All Users\Application Data\HP\HP BTO Software\installation\bundles\Operations-agent\opc_inst.vbs"
s2003Command3 = "E:\Documents and Settings\All Users\Application Data\HP\HP BTO Software\Data\installation\bundles\opc_inst.vbs"
s2008Command = "C:\Users\All Users\HP\HP BTO Software\installation\bundles\Operations-agent\opc_inst.vbs"
sCatchAll = "%ovagentdir%\installation\bundles\Operations-agent\opc_inst.vbs"

For Each oService in colServiceList

 If oFSO.FileExists(s2003Command1) Then
  errReturn = oShell.Run("cscript " & chr(34) &  s2003Command1 & chr(34) & " -remove", 0, False)
 ElseIf oFSO.FileExists(s2003Command2) Then
  errReturn = oShell.Run("cscript " & chr(34) &  s2003Command2 & chr(34) & " -remove", 0, False)
 ElseIf oFSO.FileExists(s2003Command3) Then
  errReturn = oShell.Run("cscript " & chr(34) &  s2003Command3 & chr(34) & " -remove", 0, False)
 ElseIf oFSO.FileExists(s2008Command) Then
  errReturn = oShell.Run("cscript " & chr(34) &  s2008Command & chr(34) & " -remove", 0, False)
 Else
  errReturn = oShell.Run("cscript " & chr(34) &  sCatchAll & chr(34) & " -remove", 0, False)
 End If

Next

Set colServiceList = Nothing
Set oWMIService = Nothing
Set oShell = Nothing
Set oFSO = Nothing


  • Edited by -Nismo- 16 hours 44 minutes ago
February 10th, 2014 2:02pm

Why don't you deploy th HP script as an application by itself?
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2014 3:29pm

Well, aside from the fact that the script could be much better written (sorry, not trying to criticize here, just pointing out that it's hard to follow exactly what you are trying to do -- instead of subsequently trying multiple permutations of the same command from different folders, you should detect the existence of the different folders -- same with the existence of the service) what does execmgr.log say when this is executed? How about throwing in some logging also so you know where the script succeeds and fails?
February 10th, 2014 5:16pm

I agree with Jason, the script could be much better. Back to my original question, why don't you deploy the HP script you're calling (opc_inst.vbs) by itself? Is the opc_inst.vbs same on every computer? Does it need to start in specific folder? If I were you, I'd examine that script and deploy it as an application with ConfigMgr.

Free Windows Admin Tool Kit Click here and download it now
February 10th, 2014 11:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics