dtsx package runs by command prompt but not by .bat file - batch-file

running a dtsx package by .bat file.
receiving the following error.
Could not load package "C:......dtsx" because of error 0xC0011002.
Failed to open package file "C:......dtsx" due to error 0x800C0006. the system cannot locate the object specified. this occurs when loading a package and the file cannot be opened or loaded correctly into the xml document.
my .bat file is:
"C:\Program Files\Microsoft SQL Server\110\DTS\Binn\DTExec" /f C:\..\..\...dtsx
however if i run the exact same code by command prompt it runs.
ideas?

Related

Batch file can not run successfully in SSIS package

In my task, I call DTEXEC /F to run an SSIS package which includes executing batch file error. But when I can run the batch file in command window successfully.
And I traced the SSIS package's process. It shows run this batch file fail.
Is there anybody faced same issues? How to resolve it?
Thanks

How to Run SSIS Package Using Task Scheduler and Batch File

I have a windows batch file that looks like this:
"C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\DTExec.exe" /FILE
C:\SSIS\CARS\CARS\PCarsCallMonthlyCount.dtsx /DECRYPT pswrd /CHECKPOINTING OFF
When I run code from the command prompt the SSIS package runs with no errors. I then created a scheduled task to run and call the same batch file. The task runs but does not error out or end.
So I then open the batch file from the command prompt and I get this error "Missing argument for option "file". The execute Package Utility application then starts and waits for some input.
So I assume I am missing something in the command and that is why the task does not complete. How can I fix this?
If the command line is exactly how you have it in the batch file, you need to make it all on one line. It is not getting the second part of /FILE which is your .dtsx file.

SSIS: Execute Process task can't execute FTP

i'm trying to transfer my data from TXT that i generate in a Data flow task to FTP library and can't do it
If i use Execute Process Task i must execute a File1.bat:
#echo off
ftp -s:fileName.txt -n
and fileName do it:
open
172.16.60.223
user
username
password
put \\dappwstd2008\paso\Esteban_Entregas\Clientes\fileName.txt BICCONVER1/CVCUREL
close
bye
If i execute the file1.bat works correctly, but can't do it with SSIS.
i tried to do the following:
Execute Process Task
Executable: D:\Users\MyName\Desktop\file1.bat
Argument: "fileName.txt"
[Execute Process Task] Error: In Executing
D:\Users\EDonosoV\Desktop\file1.bat" ""fileName.txt"" at "", The
process exit code was "2" while the expected was "0".
i change success value to 2 and work but CMD do nothing
Any solution?, i tried using the code of the TXT in FTP Task and have problem with RemotePath because my destiny is a library and can't open it
Thanks!
Try copying your filename.txt into C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn (If you are using SSIS 2010)
Similar path for 2008 or 2014
This is the "Working Directory" when you run BIDS
Or just fully qualify the path
I solved it!
i must write the route of the folder with .bat and .txt inside in Working Directory
Executable: D:\Users\MyName\Desktop\file1.bat
Argument: "fileName.txt" (This file inside Desktop or the same folder of file1.bat)
Working Directory:D:\Users\MyName\Desktop\
And work it, transfer my Flat file to FTP!
Thanks for the comment and i hope help someone else with the same problem!

MSBuild execution fails through jenkins whereas same command runs properly through command prompt

I tried to execute the below command from Jenkins, and I got below error. I tried to print the command and executed the same command through cmd.exe and it runs successfully. I checked the folder permission and it is having the write permission. I ran jenkins using war file and saw it is executing under the same user as cmd.exe is running
Command that is executed on both jenkins and cmd.exe is,
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "d:\jenkins\workspace\NewTestItem\App\abc.sln" /t:rebuild /p:PackageLocation=d:\jenkins\workspace\NewTestItem\iisPackageDeploymentDir\26\ /p:DeployOnBuild=True /p:Configuration=Release /m /v:d /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
Error which I am getting in jenkins
Microsoft.Common.CurrentVersion.targets(3821,5): error MSB3021: Unable to copy file "d:\jenkins\workspace\NewTestItem\App\mgmt\UserGuide\US\help.pdf" to "bin\mgmt\UserGuide\US\help.pdf". Access to the path 'bin\mgmt\UserGuide\US\help.pdf' is denied.
Note : Solution contains multiple project

Executing FART.exe (find and replace text) commands on remote server through SSH

I'm executing a batch file on a remote server from our build server (Jenkins) through SSH. The batch file uses fart.exe commands to find and replace text. I have placed the fart.exe in C:\Windows\System32 and I'm invoking it as C:\windows\system32\fart.exe in the batch file.
The command works perfectly fine oin the remote server, but when invoking through SSH I get an error in the Jenkins log as:
'"C:\windows\system32\fart.exe"' is not recognized as internal or external command.
This is the only error I'm getting and the other commands successfully execute in the batch script. Both of the servers are Windows Server 2012 R2.
I tried adding the path to system variable but it didn't work.
This is how the Fart.exe is used in the batch script.
for /R "%BACKUP_SOURCE%" %%G in (%ConfigFile%) do (
"C:\windows\system32\fart.exe" "%%G" %PlaceHolder% %AppPath%
)
Invoking From Jenkins
I don't think the way i invoke the batch script do matter, because it is done trough the Jenkins SSH plugin. The batch script get invoked successfully. The error i get is from when executing the Fart.exe
I tried invoking a different command of an exe located in the same path, and that is successfully invoked. so i guess the issue is isolated to FART.EXE.

Resources