65.9K
CodeProject is changing. Read more.
Home

Servex - using batch files for remote ftp

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.58/5 (3 votes)

Apr 15, 2004

1 min read

viewsIcon

69556

downloadIcon

718

Remote Commands on a Computer

Introduction

This uses a batch file through an ftp site and communicates information through the site. The server file will loop and keep trying to execute a file on the ftp site the client will place that file on the site and the server will finally execute it after it really exists. In the Client you type the .bat file you wish to execute on the remote computer. You can make it send a response to check for a connection as shown below.

Using the code

Open dos and get into the directory the client is in, type the filename of the client then before you hit enter hit space and then the batch file you wish to execute on remote computer. After you have done that hit enter. I don't like doing it that way but I did that to make it compatible to Win95/98. For this to actually work the client must be opened first.

echo open>ftp.txt
echo servex.europe.webmatrixhosting.net>>ftp.txt
echo servex>>ftp.txt
echo password>>ftp.txt ("password is the password")
echo put respond.bat>>ftp.txt
echo bye>>ftp.txt
echo set resp=here>respond.bat
ftp -s:ftp.txt
delete ftp.txt
delete respond.bat

Points of Interest

I have always loved using ms-dos to create programs because you can do practically anything with them, if you put your mind to it. Well i spent about 10 minutes on the client/server program, and tested it, it seems to work just fine. I highly recommend batch programming and if you have any questions over any ms-dos stuff just let me know.