我试图在我的WinSCP脚本中构建日志路径和lcd变量,并且我不知道如何使用正确的语法。
如何正确地将变量放入脚本中?这就是我想要做的一个例子。
$logPath = "c:\LogPath"
$lcdPath = "c:\lcdPath"
& "C:\Program Files (x86)\WinSCP\WinSCP.com" `
/log = $logPath /ini=nul `
/command `
"open ftpSite -hostkey=`"`"hostKey`"`" -rawsettings FSProtocol=2" `
"cd ftpFilePath" `
$lcdPath `
"get * -filemask=*>=1D" `
"exit"发布于 2022-09-20 12:33:17
使用变量的语法是正确的。是你的WinSCP命令行语法错了。
https://stackoverflow.com/questions/73786442
复制相似问题