Hi Martin,
I just understood the problem myself. I have give wrong statement
call "./!" /root/upload/config/File1.bat
correct statement is:
call /root/upload/config/File1.bat
Thanks Martin. I am facing another problem which I have stated below. I will raise the same in a new thread also.
I am automating the process of editing a properties file with sed command. The below command will be available in the File1.bat
sed -i '/old/c\newvalue' /path/path/filename.properties
Then I will invode Winscp.com and run the call batfilename will edit my properties file. But when I run the code (ie call /root/upload/config/File1.bat ), file editing is not successful. I get no such file or directory. If I open the .bat file via winscp.exe editor and make some change then save it and close it and then if I execute the bat file manually, it is succeeded.
Not sure how to fix this issue.
You are combining like three different WinSCP features in a way that cannot work together.
Can you explain us what are you trying to do?
What is File1.bat
? Where do you have that "code"?
Hi all,
I am facing an issue when I try to run the Execute custom remote command. I am getting the error
-bash:line 16: ./!: No such file or diretory. But the file really exists in the specified path.
Basically I want to execute a .bat file that is available in the remote system through the custom remote command "Execute" ("./!"). I want to achieve this through scripting.
Please find below the code:
option batch abort
option confirm off
open sftp://xxx:yyy@zzz.zz.zzz.zz/ -hostkey="sdf"
call "./!" /root/upload/config/File1.bat
close
I will run the above code through winscp.com
Any help will be greatly appreciated.