FTP from unix shell script to windows

Hi,

I m trying to connect/establish FTP from unix shell script to my PC.Below the script i have written

#!/bin/ksh

ftp -v -n ddcappip01.com << "EOF"
user Amit jason
bye
EOF

------------------------------ERROR--------------------------

but i m getting the below error for the above script:

ftp : Unknown host ddcappip01.com
Not connected.

------------------------------------------------------------------------
Another try i gave but this time its getting hanged in command prompt:

#!/bin/ksh

REMOTESERVER=10.99.199.80
LOGIN='Amit'
PASSWORD='jason'
ftp -n $REMOTESERVER << INPUT_END

quote USER $LOGIN

quote PASS $PASSWORD
pwd
bye

INPUT_END

How to do FTP from unix to my PC?
Also how to get the name of my PC?
And how to use ip address of my pc instead of name in my script ?

So far you did nothing wrong. ftp is ftp no matter if you do it from unix to unix or unix to windows etc. Basically it is a somewhat unified File Transfer Protocol, no matter which platform it is running on.

Your problem is here:

At first make sure you can reach that host from your box or else everything following will fail of course.

Also when i m using the PC ip address then also i m not able to connect, but from my PC command prompt i m able to connect to my unix server.

How to achieve this using in k-shell script ..........Above i have written the code using IP address

FTP service should be enabled in the destination machine.
In you case you are trying to FTP from Unix to windows. So FTP should be enabled in your windows machine.

I m able to do FTP from my PC to UNIX

Thanks in advance..........

Below are the steps to set up FTP Service in Desired PC:


How do I set up Windows 2000 or XP Professional to accept FTP transfers?

Installing IIS
For Windows XP Professional systems running in the default Start menu configuration, click Start, then Control Panel, then Add or Remove Programs. In Windows 2000 (or in XP if it is set to classic Start menu view), click Start, then Settings, then Control Panel, and then double-click Add/Remove Programs.


Click Add/Remove Windows Components.


Double-click Internet Information Services. This will open another window listing the IIS subcomponents.


Check File Transfer Protocol (FTP) Server. The Common Files and Internet Information Services Snap-In boxes will also check by default. Make sure no other boxes are checked, and then click OK. 
Note: Windows may prompt you for your Windows CD at this point.

Configuring the FTP server
On the desktop or Start menu, double-click or click My Computer, and then double-click the hard drive on which you have Windows installed. 


Open the folder inetpub. Right-click the ftproot folder and select Properties.


Click the Sharing tab. Select the radio button Share this folder and click Permissions. From the list that appears, select Everyone, and then click Remove. 


Click the Add... button. In the drop-down list, select your computer's name. In the list of user groups that appears in the center scrollbox, select Users. Click Add, then OK. In the Permissions window, set the access level. If a user needs only to download files from your computer, set the access to Read. To give upload permission, also check Change. Click OK.


Create user accounts for each of the individuals who will need to access your server. You can do so by opening the Control Panel and then double-clicking the Users and Passwords icon. For each user, you will need to provide a username and domain. At IU, use the Network ID username, and enter ADS for the domain. 


In the main Control Panel window, double-click Administrative Tools, and then double-click the Computer Management icon. A new window will open. On the left, beside Services and Applications, click the + (plus sign), and then click the + (plus sign) beside Internet Information Services. 


Right-click Default FTP server and select Properties. Under "Services", make sure that Allow anonymous connections is not checked. This will prevent unauthorized access to your workstation. Click OK, and then close all windows. 
Your computer should be ready to accept FTP connections.