Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:26:59+00:00 2026-05-30T05:26:59+00:00

All, I am using a batch file to automate the deployment of SSIS packages

  • 0

All,
I am using a batch file to automate the deployment of SSIS packages out to MSDB. I am using a START /WAIT command in a FOR loop to iterate through all files in a folder and execute the DTUTIL command.

While I know I can return the %ERRORLEVEL% and use it in the main batch process, what I am losing is the specific error message that DTUTIL outputs.

I want to be able to capture that message output, but I have yet to find a way to. I tried chaining commands by using the &&, || and & concatenation commands. And I also tried to use > and 2> to put the output into a file. Nothing has given me the desires output.

And to be specific, I’m mainly concerned with when DTUTIL ERRORS and the message is more relevant than the error code alone.

Any help or recommendations would be appreciated. Here’s the code:

@echo off

SET /P SOURCEFOLDER=Enter the Source Folder where the Packages are located:
SET /P DESTSERVER=Enter the Destination Server:
SET /P DESTLOCATION=Enter Destination Folder (Leave blank for root):

IF NOT EXIST "%SOURCEFOLDER%\*.dtsx" GOTO NOFILES

FOR /F "usebackq delims==" %%i in (`dir /b "%SOURCEFOLDER%\*.dtsx"`) do (
ECHO.
ECHO ^>^>^>^>^>^> Copying %%i to %DESTSERVER%\MSDB\%DESTLOCATION% ^<^<^<^<^<^<^<
ECHO.
START /WAIT dtutil /FILE "%SOURCEFOLDER%\%%i" /DESTSERVER %DESTSERVER% /COPY SQL;"%DESTLOCATION%\%%~ni" /QUIET
ECHO %ERRORLEVEL%
ECHO.
)
GOTO COMPLETE

:NOFILES
ECHO.
ECHO *** No SSIS Packages were found.  Please verify the folder location:
ECHO %SOURCEFOLDER%
ECHO.
GOTO END

:COMPLETE
ECHO.
ECHO All Packages have been Processed.
ECHO Please verify that no Error Messages or Warnings were returned.
ECHO.
GOTO END

:END
PAUSE
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:27:00+00:00Added an answer on May 30, 2026 at 5:27 am

    Simplest would be to drop start and just issue Dtutil (since you wait till it finishes I cannot see a difference). Another two possibilites

    start /B dtutil >result.txt
    

    or

    start cmd /c dtutil ^>result.txt
    

    (^ is used to escape special chars, here redirection symbol >) (and you already use it…)

    Redirect stderr would be 2>result.txt, both stdout and strerr >result.txt 2>&1 (escaped if used with cmd /c: ^>result.txt 2^>^&1)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to automate DNS zone creation by using a batch file fired
I'm using a batch file to concatenate all my css files copy /b reset.css+action-plan.css+buttons.css+behaviours.css+footer.css+forms.css+header.css+home.css+layout.css+lightbox.css+print.css+questionnaire.css+typography.css+you-told-us.css
I start the msysGit Bash using the provided batch file (the one that simulates
Trying to write a batch file that will loop through all the files in
Firstly, I am not at all familiar with Windows batch file programing. Recently I
At the moment i use selenium using HTMLSuite. The command i use to start
I wrote a small batch file to rar all contents in all subfolders within
I am using the batch file example below that I got from batch file
I have a batch file that runs some SELECT queries using sqlcmd, puts the
When i am using batch file for invoking msbuild.exe ,logging functionality works fine. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.