How to execute a .cmd file on remote server through SSIS package

  • Hey:

    I have a SSIS package on Server A and a .cmd file need to be executed on Server B. I saw some people recommand use PsExec to do this kind of work. so I downloaded PsExec on Server B. and use execute process task to call .cmd file from SSIS side.

    Here is my setting in execute Process task.

    when i execute the package it didn't give me any error message, just stuck there. with a black comand line window.

    can anybody tell me why?

    thank you!

  • the picture wasn't loaded succesfully

    Here is my setting on execute process task;

    executable: PsExec \\servername\C$\WINDOWS\system32\cmd.exe

    arguments:\\servername\e$\EnterpriseServices\ClaimScraperV1.cmd

    ClaimScraperV1.cmd is the .cmd file i am talking about.

  • if ServerA is going to issue a command(s) on serverB, psexec must be installed on ServerA

    also i believe on a per user basis, you need to call psexec at least once to agree to the terms/usage, then you can run it via command line.

    make sure you know which account is going to be calling the command line on serverA, since it needs rights to psExec locally on ServerA, and all the network shares in between. and the network share

    that most likely means the service account under SQL and the SQL agent needs to be network domain accounts.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell, thank you for your reply. the .cmd file siting on Server B. On server A, I tried to use ssis , execute process task to call this command file on server B. I installed Psexec on both Server A and B. still, when i run ssis package on Server A, a command prompt window pop up and stuck there untill i close it but do nothing. that .cmd file on server b is supposed to execute an application to process a set of data and put data back into database on server A. it just doesn't do that.

    I am not sure if my setting on execute process task is correct

    in executable: i put

    psexec \\serverB\C:\WINDOWS\system32\cmd.exe

    Auguments: e:\EnterpriseDataServices\ClaimScraperV1.cmd

    that is the directory on server B.

    thank you!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply