使用执行流程任务将变量值传递到 .bat 文件中 [英] Passing Variable values into .bat file using Execute Process Task
问题描述
我有一个带有 foreach 循环容器的 ssis 包.我正在尝试使用 execute Process 任务在 foreach 循环容器中使用 .bat 文件.如何配置我的 Execute Process 任务以将值传递到我的 .bat 文件中?
I have a ssis package that has a foreach loop container. I am trying to use .bat file within the foreach loop container using execute Process task. How do I configure my Execute Process task to pass the value into my .bat file?
这是我的序列:
执行 sql 任务(将我的变量传递给 foreach)--> Foreach 循环容器----> 执行进程任务(我需要有关可执行文件、参数的帮助....)
Here is my sequence:
Execute sql task (passing my variable into the foreach)--> Foreach loop container----> Execute Process Task (I need help with executables, arguments....)
推荐答案
- 在您的 SSIS 包中创建 2 个变量.
- 第一个将包含 FileName 和整个路径.
- 另一个变量将其属性评估为表达式"设置为 TRUE,并将其表达式设置为以下内容 -"local:" + @[System::FilePathVariable] + " -d HDMS:/To_HDMS/"
只要在您的 SSIS 包中引用了第二个变量,它的表达式(上面写的那个)就会执行.
As soon as the second variable is referenced in your SSIS package, its expression (the one written above) would execute.
假设 FilePathVariable 的值为D:\Folder1\Folder2\FileName";因此,计算其表达式后的第二个变量的值将是local:D:\Folder1\Folder2\FileName -d HDMS:/To_HDMS/"
Say the FilePathVariable had the value "D:\Folder1\Folder2\FileName"; so, the value of the second variable after its expression is evaluated would be "local:D:\Folder1\Folder2\FileName -d HDMS:/To_HDMS/"
您需要将此作为参数传递给您的批处理文件.这将按照我在上一篇博文中的解释来完成.
You need to pass this as an argument to your batch file. This would be done as explained in my previous post above.
在您的批处理文件中,将命令设为 -
In your batch file, have the command as -
C:cd \Program Files\WS_FTP Pro\wsftppro -s %1
C: cd \Program Files\WS_FTP Pro\ wsftppro -s %1
如果它对您不起作用,请尝试告诉我们.
Please try and let us know in case it doesn't work for you.
这篇关于使用执行流程任务将变量值传递到 .bat 文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!