August 11, 2009 at 8:27 am
Hi Darren,
You might already have tried this but other way to tracking error is by doing:
PRINT @sDosCommand
before executing the command and see if there are any obvious typos or syntax error in the line and then copy paste the whole printed out line in your cmdshell command.
Umer
May 19, 2010 at 2:50 pm
Heheh! Great catch. I knew about redirecting Y and xp_cmdshell, just never brought the two together (this is my Reese's Peanut Butter Cup 😉
Here's what I ended up with:
master..xp_cmdshell 'echo Y > c:\temp\y.txt & c:\ssis\packages\bin\pscp.exe -l Us3r -pw p@ssw0rd c:\SSIS\Packages\Output\1108.txt remote.server.com:/home/path < c:\temp\y.txt & del c:\temp\y.txt'
June 2, 2010 at 10:46 pm
James Rizzo you rocks!!!
I just registered to thank you!!!:-D
August 26, 2010 at 11:19 am
I had same problem and solved it by adding the Hostkey in the Registry Editor in HKEY_CURRENT_USER\Software\SimonTatham\PuTTY
August 26, 2010 at 11:38 pm
akhilesh.aggarwal123 (6/2/2010)
James Rizzo you rocks!!!I just registered to thank you!!!:-D
That's a cool thing to do.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 5, 2010 at 5:59 pm
Thank you James!!! That was the solution I've been looking for.
January 7, 2011 at 7:41 am
Just wanted to thank James for this as well. I've been stuck on this issue for a couple of months!
July 27, 2011 at 2:35 am
James Rizzo (9/6/2007)
I know this is a very old thread but I have yet to see a solution to this problem if your SQL Server is running as the local system account - so here it is!
1. Create a text file with the letter Y and a carriage return in it:
For examle :
Y
<blank line>
2. at the end of pscp command add the following:
<STRONG><</STRONG> <name_of_your_text_file_created_in_step_1>
THATS IT !!
Basically, the less than character '<' will redirect the contents of the text file to the input of the pscp command, answering the prompt automatically for you.
Hope this is of some help to somebody sometime.
Thats a real good advice by James!!!! From Russia)
November 29, 2011 at 1:17 pm
That did the trick for me as well using psftp. Just a heads up to anyone who is trying to automate this using psftp you can use the same < followed by the file name to bypass the prompt. My command string looks like this:
C:\SFTP\psftp.exe 1.1.1.1 -l user -pw password 1 -b C:\SFTP\ESRI.txt -P 22 < C:\SFTP\cache.txt
cache.txt has in it:
y
(return)
Tried it on my SQL sa account and works like a charm. Thanks for the tip!
Ivan
Viewing 9 posts - 16 through 23 (of 23 total)
You must be logged in to reply to this topic. Login to reply