IT Process Automation

Expand all | Collapse all

Run Script Operator

  • 1.  Run Script Operator

    Posted Mar 12, 2013 03:23 PM
    Hi All,

    I am a little bit confuse how to use "Run Script" operator.

    Suppose For example I need to create a directory. I passed MKDIR in Inline Script and folder name "FN" in parameter. So it should create one folder named as "FN", bu *** says invalid statement.

    Any idea?


    Regards,
    Varun


  • 2.  RE: Run Script Operator

    Posted Mar 13, 2013 02:13 PM
    Varun,

    Are you referring to the parameter you passed in your inline script? If it's a batch file, it should read something like:

    mkdir %1

    Otherwise, it will generate an error similar to "The syntax of the command is incorrect."

    - Sam


  • 3.  RE: Run Script Operator

    Posted Mar 13, 2013 02:23 PM
    Hi,

    I am passing "mkdir" in Inline Script and folder name "FN" as a parameter.

    And I am getting the same error what you have mentioned it.

    Regards,
    Varun


  • 4.  RE: Run Script Operator

    Posted Mar 13, 2013 03:57 PM
    Hey Varun,

    You need to treat the script just as if it were running outside of PAM. So for example if you have a batch script and you want to pass parameters to the script, you reference those parameters using %1, %2, etc. And actually I recommend %~1, %~2, etc instead to get rid of quoting issues.

    So for your script here, you'd want "mkdir %~1" as the inline script and then that would pick up and use the first parameter you pass in.

    Thanks,
    Tom


  • 5.  Re: Run Script Operator

    Posted Jul 22, 2016 01:32 PM

    Hi,

     

    I have a script that has 10 parameters.

     

    But, the value of %10 is not work in script.

     

    Its possible use only 9 paramaters?

     

    Or the problem is the way the describe?



  • 6.  Re: Run Script Operator

    Broadcom Employee
    Posted Jul 22, 2016 02:39 PM

    Not sure what you are attempting, but you should be able to use more than 9 parameters in a script.  We would need to know more about what you are attempting to be of more assistance.  



  • 7.  Re: Run Script Operator

    Posted Jul 22, 2016 03:14 PM

    My operator script need to use 11 parameters.

     

    By when I execute, the operator use the parameters %1 to %9 normally, but %10 and %11 is not load to script.

     

    I trust that %10 is incorrect syntax for it.

     

    Thanks



  • 8.  Re: Run Script Operator

    Broadcom Employee
    Posted Jul 22, 2016 03:29 PM

    If you remove all but parameter 10 and 11, so they work individually?

    Or if you move 10 and 11 to be number 1 and 2 do they work as expected?

     

     

    Maybe you could share your script with us?  Might be better if you share the script and more about what you are trying to accomplish with the script?



  • 9.  Re: Run Script Operator

    Posted Jul 22, 2016 03:39 PM

    parameters.PNG

    Hi Michael,

     

    GRLoader -dbdriver %1 -dburl %2 -dbuser %3 -dbpswd %4  -u %5 -p %6 -E -s %7 -E -dbstmt "%8" -a -e %9 -n -tf %10

     

    This is a cmd line and the parameters input in PAM.

     

    Thanks



  • 10.  Re: Run Script Operator

    Posted Jul 23, 2016 07:35 AM

    Hi, I think you have to use the shift command

     

    exemple

    SET ONE=%~1

    SET TWO=%~2

    SET THREE=%~3

    SET FOUR=%~4

    SET FIVE=%~5

    SET SIX=%~6

    SET SEVEN=%~7

    SET EIGHT=%~8

    SET NINE=%~9

    SHIFT

    SHIFT

    SHIFT

    SHIFT

    SHIFT

    SHIFT

    SHIFT

    SHIFT

    SHIFT

    SET TEN=%~1

    SET ELEVEN=%~2

     

    Passing more than 9 parameters to a batch file | Tech Updates



  • 11.  Re: Run Script Operator

    Posted Jul 25, 2016 06:52 PM

    Its working.

     

     

     

    Thanks  for help!!!



  • 12.  Re: Run Script Operator

    Broadcom Employee
    Posted Jul 22, 2016 03:42 PM

    That's a service desk command correct?   Does I work like that outside of Process Automation?