Post a reply

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)


Topic review


Re: Run command fails with "Unknown command" error

Thanks for your answer it helped!

Re: Run command fails with "Unknown command" error

You are mixing WinSCP commands with shell commands.

If you want to execute a remote shell command in WinSCP, try the call command:
call setsid /tmp/ >/dev/null 2>&1 < /dev/null

Note that you cannot use & in WinSCP, I've removed it from the command above.
Or use an appropriate tool to execute remote shell commands, like Plink.

Run command fails with "Unknown command" error


I have a scenario where I have to copy a sh script and multiple ESXi hosts, Change the permission and run it.
The file copy is working fine.
For changing the permissions chmod +x wasn't accepted but the workaround was to use chmod 755.
To run the script I run it in a new session using setsid (as described in VMware KB). Unluckily WinSCP returns "Unknown command ''setsid'." error message while running the same in PuTTY works fine.
Full code used is the following:
open %1%
put "C:\temp\\" /tmp/
put "C:\temp\\" /etc/rc.local.d/
chmod 755 /tmp/
setsid /tmp/ >/dev/null 2>&1 < /dev/null &

Could you confirm this is the correct way to proceed?
Or what I am doing wrong?

Thanks a lot in advance for your help,