Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

martin

Re: Scripting ... problem with xp_cmdshell

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

Re: Scripting ... problem with xp_cmdshell

martin 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

Re: Scripting ... problem with xp_cmdshell

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
Kathy

Scripting ... problem with xp_cmdshell

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. :?

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'