Batch Files

aneilg
aneilg used Ask the Experts™
on
when i run the following batch from from its location it works, bu twhen i run it from a ssis package in a execute process task i get the following error.
C: 
CD C:\Program Files\WinSCP\
winscp.com  /command "option batch abort" "option confirm off" "open to:dan@" "cd /for" "put ""\\s-001\Data\data\Extracts\ArchivePath\ArchiveFiles\aaa.csv""" "EXIT"



Extract.bat" "" at "", The process exit code was "1" while the expected was "0".

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Kamaraj SubramanianApplication Support Analyst

Commented:
in your .bat file put this single line only

C:\Program Files\WinSCP\winscp.com  /command "option batch abort" "option confirm off" "open to:dan@" "cd /for" "put ""\\s-001\Data\data\Extracts\ArchivePath\ArchiveFiles\aaa.csv""" "EXIT"  

Open in new window

Author

Commented:
thanks but just tries that and it does not work.
Application Support Analyst
Commented:
can you put echo in front and give the output

echo C:\Program Files\WinSCP\winscp.com  /command "option batch abort" "option confirm off" "open to:dan@" "cd /for" "put ""\\s-001\Data\data\Extracts\ArchivePath\ArchiveFiles\aaa.csv""" "EXIT"

Open in new window

 
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Commented:
Is line #7 your output.... the arrangement of quotes is a bit odd!

Have you thought about just running the exe from your process rather than a batch file?

Also has whatever this is being run as got access to the share \\s-001\Data and the folder beneath it.

You could create a batch as follows to see some more info:

@echo off
(
echo Current dir: %cd%
echo Batch filename: %~f0
pushd "\\s-001\Data"
dir
dir "data\Extracts\ArchivePath\ArchiveFiles\aaa.csv"
"C:\Program Files\WinSCP\winscp.com"  /command "option batch abort" "option confirm off" "open to:dan@" "cd /for" "put ""data\Extracts\ArchivePath\ArchiveFiles\aaa.csv""" "EXIT"
popd
) > "%temp%\logfile.txt" 2>&1

And that will write those details to a log file in temp drive.

Author

Commented:
i think its something to do with the exit and using the "" or ,

Commented:
So what does the test file above do?

Commented:
Is the failure occurring on an x64 box?  Perhaps you need c:\program files (x86)?

Author

Commented:
not fully resolved

Commented:
As with your other question closed in the same way.... rather than offering a "B" grade and no feedback perhaps you could either give us feedback so we can work more on it, or enlighten us and others reading this in the future with what DID fix it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial