Symantec Management Platform (Notification Server)

 View Only
  • 1.  Executing VBScript file on clients via SMP Task

    Posted Jun 04, 2012 11:28 AM

     

     

    I've been trying to execute a vbscript file from the local client computer by using a "Run Script" task, but everytime i run the task and check the task instance details, I see the following message under "Output Properties":

    Script:  Microsoft (R) Windows Script Host Version 5.7
    Copyright (C) Microsoft Corporation. All rights reserved.
    C:\WINDOWS\TEMP\AltirisScript041B41208BA19A149C9DD.vbs(1, 11) Microsoft VBScript compilation error: Expected statement
     
    If I go into the task's advanced properties and uncheck the box for "Save script output with task status" and run the job again (it does fail) and I receive a return code of "1".
     
    Of course, if I run the VBScript from the client machine locally it works like a charm. No problems. Can anyone help me understand what's happening and perhaps how best to troubleshoot it?
    Thanks!
     
     

     

     

     



  • 2.  RE: Executing VBScript file on clients via SMP Task

    Posted Jun 04, 2012 01:27 PM

    Does the script require network access?  If so, the SYSTEM account it normally runs under isn't allowed to access the network.



  • 3.  RE: Executing VBScript file on clients via SMP Task

    Posted Jun 04, 2012 03:36 PM

    Id go with zac, what you normally see is that a vbscript will be calling a unc path but trying to run as system. Run it with an account with access to the share and admin rights on the machine and it will probably be fine. 



  • 4.  RE: Executing VBScript file on clients via SMP Task
    Best Answer

    Posted Jun 05, 2012 07:38 AM

    I tried changing the account that the task runs under earlier this morning, but I was still having the  compilation" error.  I believe the way i was calling the vbs file was incorrect. Originally, I was executing this in the task's script editor window:

    cscript.exe "c:\myFolder\myVBSfile.vbs"

    I got it to work by changing it to the following:

     

    Set oWsh = CreateObject("WScript.shell")
    oWsh.Run("c:\myFolder\myVBSfile.vbs", 0, True)
     

    Once that worked, I dressed it up a bit to pass the response/error codes to the executing task:

     

    Dim oWsh, response
    Set oWsh = CreateObject("WScript.shell")
    response = oWsh.Run("c:\myFolder\myVBSfile.vbs", 0, True)
    wscript.quit(response)
     
    But what do you know... THEN I had an issue with the account it was running under! So thanks for the advice, it really helped.