Pass Passord Variable to a Batch File using Execute Process Task

I have an FTP batch file that I want to execute using Execute Process Task. The content of the ftp (ftpscript.cmd) is as below:
open ftpsite
UserName
Password
ASCII
get file  c:\temp\test.txt
bye
Using SSIS Execute process task, I was able to download data. I configured the Execute Process task as follows:
Executable: ftp.exe
Arguments: -s:"c:\temp\ftpscript.cmd"
The above works fine. But the problem is that I don't want to store the password value in the batch file for security/policy reasons. Please, is there a way I can pass the password value to the ftp executable or the batch file at run time?
I know how to get and store variables in SSIS but I don't know how to pass this kind of variable to the batch file just before execution.
Any suggestions will be appreciated. Thanks.

you can dynamically generate the source (CMD) for the FTP and delete after the execution. The password can be stored in a secure database for example, not 100 % secure, but the best you can do.
Another option I did was an encrypted VBScript (also quite easy to open in plain text to some people).
Finally it can be a binary e.g. an EXE with the FTP called as process in it.
Arthur My Blog

Similar Messages

  • Calling Remote Batch File Using 'Execute Process Task'

    I have a remote batch file on machine B that I need to execute using 'Execute process task' control from a package on machine
    A.
    How can i achieve this...

    You also need to make sure you run the job using a domain account proxy http://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/
    Arthur
    MyBlog
    Twitter

  • Passing Argument from Execute Process Task (SSIS) to an .exe file

    Hi,
    I am developing a SSIS package, where I want to execute exe file using Execute Process Task. The parameter for the ,exe file is the output of the SQL query from database.
    I am not knowing how to pass the output of the SQL query to the parameter of the Exe file. Can you please let me know how to pass the sql output data as parameter to the exe.
    Many Thanks, Thirumalai M

    Hi,
    you can use the following tutorial fr more information.
    http://www.sqlis.com/post/The-Execute-SQL-Task.aspx
    After getting the data in the variable, you can easily pass the variable in as a parameter for the "Execute process task".
    -Jens
    Jens K. Suessmeyer http://blogs.msdn.com/Jenss

  • Execute SSIS Package from JOB which contains Execute Process Task calling a .bat file

    Hi All,
    I have a EXCEL Macro needs to be called from SSIS. We could not use Script task because of some internal reason.
    So we have taken an approach to call a .BAT file using Execute Process Task. This .BAT file will call a .VBS file which will execute the EXCEL Macro.
    The SSIS Package is running good if I execute the package from BIDS.
    But the real problem is with the scheduling this SSIS Package using SQL JOB.
    If i execute this SSIS package from SQL Server Job, its executing the whole package successfully except the Execute Process Task.
    So the overall issue is SQL Server Job is not executing properly if I call any .BAT file from the SSIS Package.
    Please give me suggestion to get rid of the issue. Thanks in advance.

    Hi Sai.N,
    If you run the SQL Server Agent job manually from SSMS, does the package execute properly? If the package executes properly when you run the job manually, the issue should occur due to permission issue. In this case, I suggest that you create a SQL Server
    Agent proxy based on the current Windows account which you use to log onto the operating system, and run the job under the proxy account.
    If it is not the issue, please enable logging in the package as Visakh mentioned and post the warning/error message for further analysis.
    Regards,
    Mike Yin
    TechNet Community Support

  • Execute process task to append file

    hi
    i am using execute process task to append one file (header)  to main file.
    in expession i am using this
    "/c copy \"" +  @[User::DestinationHeader] + "\" \"" + @[User::FinalFile] + "\""
    but only header is coming ,not the file content.
    what should be corect syntax and what should i put in argument

    cmd.exe
    i cant use .net as its not supporting large files
    You can use method like below also
    http://agilebi.com/jwelch/2008/02/08/adding-headers-and-footers-to-flat-files/
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Running a Batch file Using Java

    hi All ,
    I am executing a DOS batch file using the Java .
    I am using it as
    Process P;
    Runtime rt = Runtime.getRuntime();
    P = rt.exec("C:\\X12TST\\BATCH1.BAT ");
    But in case BATCH1.bat have call to some other Batch File Say Bactch2.bat , i am not getting the output of BATCH2.BAT .
    My Java Program exits as soon as it enters to the point where BATCH1 is calling BATCH2 using (call BATCH2.bat).
    Any help is resolving the problem is highlt appreciated .
    Please advise me if you have any alternative to solve the problem .
    Thanx in advace

    The Runtime.exec() should'nt be used with a .bat or .cmd file since .bat and .cmd are not really executable. I think the expected behaviour you experimentred is a process hang at the last command line of the .bat file.
    Insert "echo XXX" or "net send mycomputer XXX" debug messages in your .bat, you'll see the .bat executes until last line. But the last one NEVER terminates, resulting in a hang in the Java thread doing a process.waitFor().
    The only workaround (or right use of exec) is to call the cmd.exe (with FULL PATH OF cmd.exe SPECIFIED in the exec() call). An exec() calling C:\WINNT\System32\cmd.exe /C mybatch.bat should return properly, cause cmd.exe is a standard Win32 program that will be launched to interpret mybatch.bat then terminate.
    PLEASE UNIX/LINUX USERS : report if the behaviour you get is the same on your plat-form, or if it is -one more- bug in win32 OS. Can you exec() a shell script direcly or do you have to exec() a "bash" or "ksh" or "csh" with you shell script as command line argument ?

  • How to run a batch file using tigger....

    Hi, i am trying run a batch file using a trigger on a table.
    say i have a table XYZ(col_1 varchar2 primary key, col_2 varchar2)
    the values of col_2 keeps changing and col_1 are constant
    whenever the value of col_2 in any row changes from "on" to "off" i want to run a batch file C:\Users\ABC\Desktop\test.bat
    i did some searching but couldn't find any solution. Thanks in advance
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    sorry wrong foum to post.
    will post in the correct one
    how to run batch file using trigger?

    Hallo,
    welcome to the forum.
    This is the forum for the tool {forum:id=260}. Your question should be placed in {forum:id=75} or {forum:id=61}.
    When you post your question there please provide additional information like db version, what kind of trigger you want to use, how you want to prevent the execution when the transaction is rolled back... {message:id=9360002}
    Regards
    Marcus

  • Why do I get error -17500 when calling a batch file using the call executable step type?

    I am calling a batch file using the call executable step type. If the path to the batch file contains a space I get error -17500 and a message stating there was an error in "Post". For example the path to the batch file is "c:\TestWin\Test Files\...\Program.bat" When I run this I get the above mentioned error, however if I change my directory structure so the path is now "c:\TestWin\TestFiles\...\Program.bat" it runs fine. I use the browse feature to find my batch file so it is not me typing in a path incorrectly. I have removed the batch file and I get a different error stating that it couldn't find the file so it appears that for my error it can find the file but can't run it. I am
    sure that this has something to do with the fact that batch files are written in DOS but really don't want to resort to changing my directory structure on all my test stations. Is there any way to fix this problem so I can leave a space in my path?

    It appears I have figured it out. This was on another computer so I was unaware of how they used their computer. I like you got it to work in the temp directory and in fact got the program.bat file to work as long as I put it under the temp directory, but when I switched out to my TestWin directory it wouldn't work, so I removed everything from the directory except the batch file it self and it work. What I found out after adding files in one at a time is that the person had a file called "Test" with no file extension in there "c:\TestWin\" directory. Removing this file made it work. Putting the file back broke it. So it appeares that when teststand was running it followed the path saw a space and attempted to grab the "Test" file instead of bro
    wsing into the "Test Files" directory. If you create a file in your temp directory called "temp" with no file extension you will see the same problem. Thank you for your help.

  • How to execute  a batch file using javascript

    Hi,
    I dont know java. i have a batch file to do my task. Im designing the front end with HTML.Can anyone tell the command to execute batchfile using javascript
    Message was edited by:
    viswanath_java

    Java and not JavaScript are not the same thing or even close to the same thing. You appear to be in way over your head. It might be a good time to fess up to your employer that you are underqualified.
    Apart from the JavaScript faux pas your question is also lacking because
    - you don't identify what this batch file is or does or needs to execute in
    - it is very difficult to understand how the front end for this will be HTML
    It seems you may one day want something like a Servlet. But you are long way from implementing this solution.

  • Can we run the batch file using simple java application

    Hello sir,
    we want to run the batch file using simple java application. i tried with some example, we run the exe files but not batch file.
    Runtime r = Runtime.getRuntime();
    r.exec("D:\\jboss\\bin\\run.bat");
    My application is server will run when we run the java appliation.
    any suggestion? plz give me the solutions

    yes you can run html file
    WEB.SHOW_DOCUMENT is a built-in that is used in Forms to call URL from a Web Form. It works much like the similar way that a link on an HTML page works and it takes two arguments, one is URL and second one is TARGET, in your case use following.
    WEB.SHOW_DOCUMENT('http://channas.iil.informatics.lk:8890/forms/frmservlet?config=abc.html', '_blank');
    Hope this will work for you
    Abbas

  • How to run batch file using trigger?

    Hi, i am trying run a batch file using a trigger on a table.
    say i have a table XYZ(col_1 varchar2 primary key, col_2 varchar2)
    the values of col_2 keeps changing and col_1 are constant
    whenever the value of col_2 in any row changes from "on" to "off" i want to run a batch file C:\Users\ABC\Desktop\test.bat
    i did some searching but couldn't find any solution. Thanks in advance
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

    >
    the script will be started around 60-70 times a day
    >
    No - as marwim said the script will be executed every time the trigger is fired. And that trigger, depending on how it is written, might be fired several times for the same transaction.
    And if the trigger is fired the script will be executed even if the transaction that caused the trigger to fire issues a ROLLBACK.
    Triggers are non-transactional. You need to clearly define the business rules for when the script should run. Should it run only when the transaction is COMMITTED? Or should it run if the transaction executes even if the transaction performs a ROLLBACK?
    A trigger is the wrong solution for your problem.
    Please clarify what the business rules are that should control the execution of the script.

  • Two questions: Executing batch files and executing a JAR on boot-up.

    I'm working with Windows XP and and currently I'm having a friend test this on Vista as well. I can't seem to find how to execute a batch file using Runtime.exec(). So far I've been passing the absolute pathname of the batch file as the argument to exec(), but it doens't seem to run, so I'm assuming there's another way.
    Second question, how do I get a JAR file to start running whenever the user turns on the PC?
    Thanks.

    I'm working with Windows XP and and currently I'm
    having a friend test this on Vista as well. I can't
    seem to find how to execute a batch file using
    Runtime.exec(). So far I've been passing the
    absolute pathname of the batch file as the argument
    to exec(), but it doens't seem to run, so I'm
    assuming there's another way.Are you using just Runtime.exec() or have you tried Runtime.getRuntime().exec()? If not, try that and see what happens.
    Second question, how do I get a JAR file to start
    running whenever the user turns on the PC?As far as I know, you can't do that programatically. You have to edit settings on your computer but I am not entirely sure.
    Thanks.

  • Error while calling pscp.exe through a batch file which is called in SSIS Execute Process Task

    Hi,
    I am using Windows Server 2012 R2 Standard, SSIS 2012. I am trying to copy files from a remote location by calling pscp.exe through a batch file (FileCopy.bat at location M:\bin\) which is referenced in a SSIS Execute Process Task. My batch file content
    is,
    ECHO OFF
    echo. >> M:\Prod\bin\SourceFile_FileLog.txt
    echo %date% - %time% - Copy Start (XYZ_a201211155952avx0_69999.NOR.gz) >> M:\Prod\bin\SourceFile_FileLog.txt
    M:\ProdFiles\bin\pscp.exe -unsafe -scp -pw aaaaa myuser@sourceserver:/ABC_data/*.NOR.gz M:\Prod\FromMediation\
    echo %date% - %time% - Copy Complete >> M:\Prod\bin\SourceFile_FileLog.txt
    The error I am getting is 
    [Execute Process Task] Error: In Executing "M:\bin\FileCopy.bat" "" at "", The process exit code was "1" while the expected was "0".
    Exactly same setup but using Windows Server 2003 R2 Enterprise and SSIS 2005, this works fine and copies the files successfully.
    Please provide some guidance on this.
    Thank you!
    'In Persuit of Happiness' and ..... learning SQL.

    Hi,
    This is what I am getting while running the batch file from command prompt
    M:\bin\mttrb1>CDR_FileCopy
    M:\bin\mttrb1>ECHO OFF
    The system cannot find the path specified.
    The system cannot find the path specified.
    scp: M:\Prod\FromMediation\: Cannot create file
    scp: M:\Prod\FromMediation\: Cannot create file
    scp: M:\Prod\FromMediation\: Cannot create file
    The system cannot find the path specified.
    'In Persuit of Happiness' and ..... learning SQL.

  • SSIS - How to run command line to copy files with User Variables within a Execute Process Task

    Hello,
    I'm am having syntax issues within the Arguments when trying to copy a file with cmd.exe using User Variables.
    It works when I hard code the arguments : /c copy /b  "\\folder1\file.txt" "\\folder2\file.txt"
    However, it's failing when I try using User Variables to replace the directory and file.
    User::FILES = \\folder1\file.txt
    User::FILE_NAME = file.txt
    "/c copy /b + @[User::FILES] + \" \\\\folder2\\" + @[User::FILE_NAME]"
    Does anybody know what's wrong with my syntax?
    Thanks!

    Hi SSISBeginner,
    Assuming the source file is "C:\Temp\Source\file.txt", the destination folder is "C:\Temp\Destination", the expression of FILES variable is "C:\Temp\Source\file.txt", and the expression of FILE_NAME variable is file.txt. Then, we can use the following
    expression for the Argument property of the Execute Process Task:
    "/C COPY /B "  +  @[User::FILES] + " C:\\Temp\\Destination\\" +   @[User::FILE_NAME]
    Note: Pay attention to the spaces in the double quotes in the expression.
    Regards,
    Mike Yin
    TechNet Community Support

  • Batch file to execute java code

    Hi,
    I need to write a batch file to execute a sequence of java applications.
    The problem i face is in addition to the usual libraries I am also using certain jar files i downloaded like the mail interface etc.
    When i just compile a java code using a simple batch file giving the path of the compiler and the java code, it fails citing not knowing the location if the packages.
    could anyone please let me know what i need to do. Is there like a skeleton that i might find somewhere for this operation

    dexterity wrote:
    Hi,
    I need to write a batch file to execute a sequence of java applications.
    The problem i face is in addition to the usual libraries I am also using certain jar files i downloaded like the mail interface etc.
    When i just compile a java code using a simple batch file giving the path of the compiler and the java code, it fails citing not knowing the location if the packages.
    could anyone please let me know what i need to do. Is there like a skeleton that i might find somewhere for this operationSet the classpath correctly at runtime.
    Why do you need the location of your compiler? Are you compiling or running? If you are compiling go look at Ant.

Maybe you are looking for

  • I am having awful problems with mouse and trackpad after installing Lion

    I have tried 3 different brands of mice and it happens with each one. the mouse clicks and sticks spontaniously and wont let go and hitting esc or trying to click somewhere else doesn't have any effect - it wont let go. And it doesn't seem to matter

  • How can i set a song as a ringtone on my ipod touch ?????

    How can i set a song as a ringtone on my ipod touch

  • Aperture and iCloud storage

    Any idea how I can up,oad images from an Aperture library to iCloud storage? So far I've managed to get some photos to transfer by selecting jPegs and then dragging to the iCloud window. But, apart from being incredibly slow, all I get is a few (up t

  • The right-click "move to group" menu item has disappeared, how can I get it back?

    <blockquote>Locking duplicate thread.<br> Please continue here: [/questions/813094?]</blockquote><br> This menu option has been there since I started using the beta. It disappeared during one of the beta revisions, but was back for RC1. In fact, I ju

  • Cube Reload and rollup ?

    Hello BW Experts, I have a cube A. There are two requests Req1 and Req2. on day 1 i have loaded the req1.1 and req2.1 and rollup done for roll.req1.1 and roll.req2.1. Now i have to reload the req1.r and req2.r. so what is the procedure to be followed