Kaseya Community

Use user input as variable

This question is not answered

Goodmorning guys,

 

Since i could not find a answer for my question i thought i would ask it here. I want to get a popup and fill in a question to ask to the current logged on user, and use that answer as a variable. So not simply Yes or No but a real answer that is different every time.

All Replies
  • Hi Jack,

     

    Use a vbscript for a prompt, and store the text the user enters into a text file.

    After this step, use the 'Get Variable' command to read the content of the output text file.

     

    Here's the script i use:

     

    strInput = InputBox("Your question here", "Prompt window title here")


    If strInput = False Then

    WScript.Echo "You pressed cancel."

    Else

    If Len(StrInput) = 0 Then

    WScript.Echo "You did not enter anything."

    Else

    Set myFSO = CreateObject("scripting.FileSystemObject")

    Set WriteStuff = myFSO.OpenTextFile("output.txt", 8, True)

    WriteStuff.WriteLine(strInput)

    WScript.Echo "Thank you."

    End If

    End If

     

    I hope this helps ;)

     

    Krijn Faber

  • Krijn,

    Cool solution but sadly this will not work on our Mac OS X 10.6.7 workstations.

  • maybe something similar to Krijn's code on a mac would be to use Python with tkinter

    the pop-up windows are easy and python is standard build with every BSD based install.

    "That's right, I called Mac BSD! :D "

  • Agreed, it's just basic scripting.

    Should be easy to find out how it's done! ;)