Home > SSIS > Executing Command Prompt commands in SSIS

Executing Command Prompt commands in SSIS


Execute Process Task is used to execute the external application in SSIS.

If you need to execute a command line commands such as DIR, COPY, DEL, RENAME, etc. then you have to use cmd.exe command that is located in c:\windows\system32\

pic1CMD.exe requires an additional argument /C while executing command line commands in Execute Process Task. Otherwise, It will not execute the given command.

In this example, I will show you how to create a folder using command line commands.

Step 1: Create a SSIS package

Step 2: Add Execute Process Task into the package

Step 3: Configure the task as shown below. The command we are using in this task will create a new folder in e drive. But, you can use the available drive letter in your computer.

pic2Step 4: Execute the package

On successful package execution, you will have a new folder SSRider in the specified drive. So, it is very simple to execute an external commands or applications in SSIS using Execute Process Task and never forget to add /C option when you are using command line commands.

Note: Command Line or Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS but it is not actually MS-DOS.

Advertisements
  1. December 17, 2013 at 8:08 am

    how to execute “.cmd” extension files in SSIS package using Execute process task

  2. December 17, 2013 at 8:09 am

    Durga :
    how to execute “.cmd” extension files in SSIS package using Execute process task
    Executable: C:\Hadoop\sqoop-1.4.2\bin\sqoop.cmd

    Arguments: /C “sqoop import -connect “jdbc:sqlserver://v-durpec:1433;database=test;username=myuser;password=mypwd;” -table emp -target-dir /user/emptable -m 1″

  3. Mark
    January 10, 2014 at 4:10 pm

    How do you then close the command window? I don’t want a bunch of instances of cmd.exe left running.

  4. January 30, 2014 at 8:35 am

    How do you input the command line from a variable?
    Thanks

    • January 30, 2014 at 8:42 am

      We can use argument property to pass command arguments through variables.

      Thanks
      Ayyappan

  5. January 30, 2014 at 10:42 am

    The Argument property in the Expressions tab!
    Thanks!
    Javier

  6. singanan
    May 30, 2014 at 10:52 am

    thanks a lot , very useful one for me..
    –Singanan

  7. Kuldip
    January 18, 2016 at 2:48 am

    how to delete first two rows from a flat file using command lines in execute process task

  8. Em
    April 26, 2016 at 7:52 am

    I have a restart.bat file that restarts the SQL Server Services and I want to call that from SSIS. When I run it from the folder mannually, I just right click and run as administrator. How could I do that in the Execute Process?

  9. jeya
    April 17, 2017 at 11:23 pm

    i have test.py file (python file) how to execute my python code using ssis. executable -python .exe(location) .arguments. python C:/test.py

  1. January 20, 2016 at 3:59 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: