Hi all, I have a following code that login into a unix server and FTP the file from unix server to my machine....I need to run a sh script and then make a FTP....how to code in a batch file...following is the code i am using:
set /p d=enter the day(dd)
set /p dt1=enter the month(mm)
set /p dt=enter the year(yy)
set /p yea=Also enter the century(yyyy)
@ECHO OFFIF "%d"=="" GOTO Exit
IF "%dt"=="" GOTO Exit
IF "%dt1"=="" GOTO Exit
IF "%yea"=="" GOTO Exitcd v:\GoldenHeart\TRD\output
> %0.ftp echo o 10.199.5.3
>> %0.ftp echo ******
>> %0.ftp echo ******
>> %0.ftp echo cd TRD_Report
>> %0.ftp echo cd data
>> %0.ftp echo cd output
>> %0.ftp echo bin
>> %0.ftp echo prompt
>>"Here I want to run TRD.sh script"
>> %0.ftp echo mget mget "TRD_report%dt%%dt1%%d%.xls"
>> %0.ftp echo mget mget "LGTSC04_%dt%%dt1%%d%.csv"
>> %0.ftp echo mget mget "LGTSC05_%dt%%dt1%%d%.csv"
>> %0.ftp echo mget mget "LGTSC01_%dt%%dt1%%d%.csv"
>> %0.ftp echo mget mget "KDMSC02_%dt%%dt1%%d%.csv"
>> %0.ftp echo bye
ftp -s:%0.ftp
I HAVE put in the my requirement above in double quotes so that you can understand at this place your support is required...KINDLY HELP ME IN THIS REGARD. LOOKING FORWARD TO YOUR VALUABLE SUPPORT
Regards,
GoldenHeart2012
Most FTP servers do not give you the ability to run arbitrary commands. Your best bet would be to use a telnet/ssh client to connect to the server in question to run your command. However, this requires third party tools to do so. If you have Vista, you might be able to use PowerShell to access .NET's System.Net.Sockets to emulate a telnet environment, but that's a lot of work.
Hi Razor2.3 Kindly help me with some example.....
BR///
GoldenHeart2012
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |