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

Author Message
Irfan S
[View user's profile]

Joined: 2016-02-04
Posts: 4
Location: Chennai, India
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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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
[View user's profile]

Joined: 2016-02-04
Posts: 4
Location: Chennai, India
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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Continues here:
http://winscp.net/forum/viewtopic.php?t=22643
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License