Sending parameters from cmd line to use within script
Hi there..
I've been wrestling with WinSCP command exe with script for the past day or so.. I'm automating software install and other admin/provisioning on a local VM. We will be using the scripting to make the VM build repeatable for a small dev team.
My exe command is being called in a shell script & currently looks like this:
and I have an
What I want to do is pass the VM IP on the command line into
I've browsed many posts on here and been redirected to https://winscp.net/eng/docs/scripting "Script Arguments".. reading that, my assumptions to make this work are:
Gather the IP details as a variable in the shell $vmip
apply this to the execution command:
When I run that command get this error:
I've tested sending text values instead of the shell variable just in case but I get the same error..
Can you give me a nudge and let me know what I'm doing wrong please?
Many thanks!!
Tony :)
I've been wrestling with WinSCP command exe with script for the past day or so.. I'm automating software install and other admin/provisioning on a local VM. We will be using the scripting to make the VM build repeatable for a small dev team.
My exe command is being called in a shell script & currently looks like this:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script="C:\VMBuild\initscript.txt" /log=C:\VMBuild\log.txt /loglevel=*
open
command in the script like this:
open sftp://guser:Grp4SS1@192.168.56.119
initscript.txt
so I can use the argument in the open
cmd. That way initscript
does not have to change when passed around the team that are working on diff machine IPs. Something like this
open sftp://guser:Grp4SS1@%1%
Gather the IP details as a variable in the shell $vmip
apply this to the execution command:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script="C:\VMBuild\scriptTEST.txt" /log=C:\VMBuild\log.txt /loglevel=* /parameter $vmip
Scripting does not use standalone parameters. The parameters you have specified on command-line will not be used. Your command-line syntax is probably wrong. Opening session using command-line parameter in scripting is deprecated. Use 'open' command instead. Searching for host... Host "C" does not exist.
Can you give me a nudge and let me know what I'm doing wrong please?
Many thanks!!
Tony :)