Topic "Scripting ... problem with xp_cmdshell"

Author Message
Kathy

Guest


Using Winscp manually, it works great (recently installed Winscp 3.8.2).
However, we have a script that does some setup and then attempts to use winscp to sftp it to a defined server. I've tried both examples below (with both winscp3.exe and winscp3.com) and cannot get it to work. Any ideas?? Feel like I've tried everything. Confused

TEST 1: ERRORS out with----'winscp3.exe' is not recognized as an internal or external command,operable program or batch file.

EXEC master..xp_cmdshell 'cd "c:\program files\winscp3"';
EXEC master..xp_cmdshell 'winscp3.exe /console /script="c:\temp\winscp.txt" WINSCPSession'

TEST 2: ERRORS out with -----'c:\program' is not recognized as an internal or external command, operable program or batch file.
EXEC master..xp_cmdshell '"c:\program files\winscp3\winscp3.exe /console /script="c:\temp\winscp.txt" WINSCPSession'
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
I do not know syntax of xp_cmdshell. At least you can try to prevent using spaces in paths by using short path: c:\progra~1\winscp3\winscp3.exe
_________________
Martin Prikryl
Kathy

Guest


prikryl wrote:
I do not know syntax of xp_cmdshell. At least you can try to prevent using spaces in paths by using short path: c:\progra~1\winscp3\winscp3.exe


I tried the short path, but I get the same error.
I also tried to set up a Scheduled Task to do this, thinking that would be a good workaround, but that does not error out, but nothing happens. In properties of the scheduled task I have: "C:\Progra~1\WinSCP3\WinSCP3.com" /console /script=C:\temp\winscp.txt

If I can't get this to work with xp_cmdshell, how to get the scheduled task to work?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Kathy wrote:
If I can't get this to work with xp_cmdshell, how to get the scheduled task to work?

Please read FAQ first.
_________________
Martin Prikryl
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