How to pass parameters to FTP script
I have a execute process task where in the expression I am setting the values of executable and arguments using following variables. These variables are being inside a normal script task using csharp code. Below is code snippet of it.
Dts.Variables[
"BatchArgument"].Value =
@"/C " + System.Environment.SystemDirectory
+ @"\FTP.exe -s:" + item.BatchFilePath.Trim() +
@">" + item.BatchFilePath.Trim().Replace(".bat",
"_LastExecutionLog.log");
Dts.Variables[
"BatchExecutable"].Value = System.Environment.SystemDirectory
+ @"\CMD.exe";
Now my further requirement is to supply some parameters to this batchfile(in ideal scenario its just an FTP script firing a put command.)
How can i do that, what all and where all places will i need to do those changes.
my current script goes like this.
ftp
open BLASERVER
BLAUSERNAME
BLAPASSWORD
put SOURCELOCATION 'DESTINATIONLOCATION' (REPLACE
quit
the whole idea is just to parameterize this SOURCELOCATION and DESTINCATIONLOCATION sections of the ftp script.
hope m clear enough on the problem statmement.
December 30th, 2010 10:43am
Wrapping your FTP script into a .bat file can be one option, this BAT file will have the parameters for the source and destination.
Then you use execute system task to call it.
Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
December 30th, 2010 11:12am
that's the last resort for me..trying to avoid that for now..looking for some direct way of doing that..
otherwise echoing the parameterized commands to the ftp script file using batch is an open option..trying to figure out any other simpler way of doing it..if any..
December 31st, 2010 2:05am
that's the last resort for me..trying to avoid that for now..looking for some direct way of doing that..
otherwise echoing the parameterized commands to the ftp script file using batch is an open option..trying to figure out any other simpler way of doing it..if any..
Free Windows Admin Tool Kit Click here and download it now
December 31st, 2010 2:05am
had to do it the same way..echoed the command of PUT while calling the FTP src file. Couldn't fine any other way of doing it. thanks
January 7th, 2011 4:52am