Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to parameterise .wsf scripts for telnet sessions?

I want to automate a task for a telnet session on Windows so that I can run it multiple times using different values.

I have a .wsf script for doing that task for one time with hard coded values.

How can I parameterise the values of a .wsf script.

Is there any way for parameterizing, like using excel where I can store all the variables and pass them dynamically to the script?

like image 515
Underoos Avatar asked Apr 04 '17 13:04

Underoos


1 Answers

<?xml version="1.0" ?><job><script language="VBScript">
<![CDATA[

Set a = WScript.Arguments
Dim i
i = 0
While a.length > i
    WScript.Echo WScript.Arguments(i)
    i = i + 1
Wend

]]>
</script></job>

and run it as wscript.exe myfile.wsf param1 "pa r a m 2" param3

like image 54
Anders Avatar answered Nov 15 '22 05:11

Anders