Jump to content


  • 0
ejon

Task Sequence - Vbscript to install software

Question

Hi,

 

I have created program packages in SCCM. Half of these software are the easy *.msi install. However some some are different - means.. running a vbscript to install. The problem is TS doesnt seem to run the VB script specified. (eg. cscript.exe vbscriipt.vbs) nor adding a registry key value (eg. regedit /s registry.reg).

 

cheers

ej

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

i had similar issues with this ... are you using run command line or install software?

 

we use run command line

 

e.g. cscript.exe //nologo c:\local\app.vbs

 

Hi jamitupya,

 

I have tried both ways.

Created a package and used Install Software TS - did not work.

Created a Run Command Line TS - failed also...

 

i have done some manual testing to prove that the syntax i have used works.

Share this post


Link to post
Share on other sites

  • 0

Hi jamitupya,

 

I have tried both ways.

Created a package and used Install Software TS - did not work.

Created a Run Command Line TS - failed also...

 

i have done some manual testing to prove that the syntax i have used works.

 

 

 

what does your log say when it fails?

 

make a test application in a batch file and test that to see if the install mechanism is working in general.

 

can you post a the logs?

Share this post


Link to post
Share on other sites

  • 0

what does your log say when it fails?

 

make a test application in a batch file and test that to see if the install mechanism is working in general.

 

can you post a the logs?

 

Did you say .. you HAD this issue? does that mean you've fixed it?

 

i will post the logs shortly

Share this post


Link to post
Share on other sites

  • 0

There is another way of doing this in your task sequence and it may work better.

 

Create a wsf script named Software.wsf

 

<job id="Software">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">
'//----------------------------------------------------------------------------
'//
'//  Global constant and variable declarations
'//
'//----------------------------------------------------------------------------
Option Explicit
Dim iRetVal

Dim sSoftInstallFolder
Dim sFile
DIM sScriptRoot
Dim env

Set env = CreateObject("Microsoft.SMS.TSEnvironment")

sScriptRoot = env("ScriptRoot")

sSoftInstallFolder = "c:\windows\temp\"

'//----------------------------------------------------------------------------
'//  End declarations
'//----------------------------------------------------------------------------

'//----------------------------------------------------------------------------
'//  Main routine
'//----------------------------------------------------------------------------
On Error Resume Next
iRetVal = ZTIProcess
ProcessResults iRetVal
On Error Goto 0

Function ZTIProcess()

On Error Resume Next

    iRetVal = Success

    ZTIProcess = iRetval
'//----------------------------------------------------------------------------
'//  Copy Post script to disk, Update RunOnce and change login settings.
'//----------------------------------------------------------------------------
       For Each sFile in Array("Install.vbs")
           If oFSO.FileExists(sScriptRoot & "\" & sFile) then
               oLogging.CreateEntry "Copying " & sScriptRoot & "\" & sFile & " to " & sSoftInstallFolder & sFile, LogTypeInfo
               oFSO.CopyFile sScriptRoot & "\" & sFile, sSoftInstallFolder & sFile, true
           Else
               oLogging.CreateEntry "Unable to copy script " & sFile & " from " & sScriptRoot & " because it does not exist.", LogTypeInfo
           End If
       Next   
       oLogging.CreateEntry oUtility.ScriptName & " COMPLETED.  Return Value = " & iRetVal, LogTypeInfo
End Function

</script>
</job> 

 

Than Create a vbs file named Install.vbs

 

Set oShell = CreateObject("WScript.Shell")
Set oFso = CreateObject("Scripting.FileSystemObject")

If oFso.FileExists("C:\MySoftwareInstaller.exe") Then
       oShell.Run "C:\MySoftwareInstaller.exe /s",0,true
End If

 

 

Place bolth files in your MDT Toolkit Scripts folder.

 

 

In your TS use the toolkit

run command line: cscript.exe "%ScriptRoot%\Software.wsf"

 

 

 

 

This is one way of modifying the script and idea documented here:

http://kongkuba1.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&_c=BlogPart&partqs=cat%3dDrivers

Share this post


Link to post
Share on other sites

  • 0

yeah we had this issue but we resolved this a long time ago. i do know we had heaps of issues with pushing software out during OSD, the only way we ever got it to work was with the cscript.exe //nologo c:\<fullpath>\script.vbs

 

we did a whole heap of things in the mean time so i will have to go back through the change management to look it up.. will do on tuesday when back in office.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.