Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Irfan S

No such file or directory when using Execute custom remote command in Winscp.com

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.
martin

Re: No such file or directory when using Execute custom remote command in Winscp.com

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"?
Irfan S

No such file or directory when using Execute custom remote command in Winscp.com

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.