Kaseya Community

Prompt for variables on scheduled scripts

  • Hi all

    Can someone confirm for me, if we have a script that prompts for a variable value when scheduled, and we schedule it to run weekly, will it just prompt us when it's first scheduled or weekly?


    Is there any way, say in a year, that we can see a reminder of what the prompt value was when it was first scheduled?



  • You have multiple way to accomplished this.

    You can have a script to capture your variable (use the get variable step) then use a step to schedule another script.

    To keep the variable history, you can insert this variable in a custom field or in a file that you store on the kserver.

  • SO, does that mean that if you schedule a recurring script which asks for a variable when it's scheduled, it will ask EACH TIME it runs? I would imagine that isn't the case surely

  • It prompts the first time you schedule it and then uses those parameters given the first time and continues to use them until the script is cancelled and rescheduled.

  • This does not appear to be working.  When i use the "prompt when procedure is scheduled" the variables get lost the the procedure is scheduled to run at a later time.  However if I do a run now everything works fine.

  • Hi damians,

    I'm experiencing the same issue and have a ticket raised with K support.  I am waiting for a response.

  • David, tell me if you have this problem as well... if you write the variable to a text file using "Write text to file" proc, is there an added " " (space) at the end of the variable?  That is another problem I found as well.

  • With regards to finding out what the parameter that was given at a later date is concerned, you could have the write a procedure log entry showing what the variable is. This way you can just look in the log for the last time it ran.

  • i know that ghettomaster, in my procedure i have another follow-up procedure that runs, that needs those variables.  That is why i write them to a file in the local kworking directory.  However Kaseya seems to add and extra space to the variable.

  • then use the shell command with the ECHO "blah blah">>C:\agentdir\text.text

    if you have no spaces before or after the >> then you wont have that anoying space at the end

  • I'll be working on updating the step to not add a space in the future, as well as enhancing it to support multiple lines being written to a file.

    For now, Michael's instructions to just use your own step to pipe your text/variable to a temp file that you then read with a "Get variable" step should let you do what you need.

    [edited by: Ben at 9:04 AM (GMT -8) on 2-20-2012] .
  • Scheduled Procedure Broken with variables nick perry bug.pdf

    I have a ticket open for this issue also. CS090485

    If I run the script right away, the prompted variable is output correctly and used as part of the script.  However any scheduling in the future causes the variable to be blanked.

    I suspect that whatever mechanism is storing the variable for the future is what's causing the issue.

  • good job nicholas can you keep us posted please

  • It looks like they found the issue and the fix is being put through QA.