Archiving source file using .bat script and call the script in command task in informatica

Viewed 22

My requirement is like below :

I have multiple source files​ in multiple source folder like in Folder ABC i have files like A​BC1.txt, ABC2.txt,...etc

In Folder DEF i have files like DEF1.txt, DEF2.txt,...etc

​Like these i have multiple folder and multiple files. I am running one workflow for ever folder to load the files and in the end i want to create command task and in that i need to call .bat file with parameter like ABC or DEF.

The .bat script will be available in scripts folder and i will call like below in command task :

D:\Informatica\scripts\Archive.bat ABC

​So this command will basically move the source folder to Archive ​folder.

I need help in creating .bat file.

1 Answers

You can use below sample batch file.

@ECHO OFF

REM PLS note to pass absolute folder Path of ABC or DEF folder 
set fol1=%1

REM PLS note to change below Archive folder as per your requirements. You can also parameterize it.
archfol="D:\Archive\"

echo Start > logarchive.txt
move %fol1% %archfol%
echo End >> logarchive.txt
Related