Batch Files

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

aneilgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kamaraj SubramanianApplication Support AnalystCommented:
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

0
aneilgAuthor Commented:
thanks but just tries that and it does not work.
0
Kamaraj SubramanianApplication Support AnalystCommented:
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

 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Steve KnightIT ConsultancyCommented:
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.
0
aneilgAuthor Commented:
i think its something to do with the exit and using the "" or ,
0
Steve KnightIT ConsultancyCommented:
So what does the test file above do?
0
uboundCommented:
Is the failure occurring on an x64 box?  Perhaps you need c:\program files (x86)?
0
aneilgAuthor Commented:
not fully resolved
0
Steve KnightIT ConsultancyCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.