»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 09-18-2003, 09:32 AM   #1 (permalink)
Registered User
 
Join Date: Sep 2003
Location: Amityville
Posts: 4
wasabi1980 is on a distinguished road
Help with Batch File Please

I have written this simple batch file and am confused why it wont work. If I manually type in each of these commands at the command prompt it works perfectly. However, whats the point of a batch file if you have to manually type anything anyways. The idea is to simply login to a ftp server delete a file and upload a new one to the same spot thus replacing it. Here is the script now:

note: password and user name have been removed.

Code:
ftp
open mywebsite.com
username
password
cd public_html
cd josh
cd current
cd blog
del blog.inc
put c:\documents and settings\josh\my documents\josheaton.tk\current\blog\blog.inc 
bye

__________________
http://www.josheaton.tk
http://www.nosnowinthesouth.tk
wasabi1980 is offline   Reply With Quote
Old 09-18-2003, 10:11 AM   #2 (permalink)
Registered User
 
OuTpaTienT's Avatar
 
Join Date: Oct 2001
Location: Bay Area, CA USA
Posts: 6,966
OuTpaTienT is on a distinguished road
Send a message via ICQ to OuTpaTienT
Once you enter "ftp" you are no longer at a command prompt. You are then running your built-in FTP software. Thus regular commands from a batch file won't work.

But I'm sure there's still a way to do this via batch programming. Someone will certainly help you here. If not, then I'll try to help ya later on today.
OuTpaTienT is offline   Reply With Quote
Old 09-18-2003, 10:25 AM   #3 (permalink)
Registered User
 
ZENYO's Avatar
 
Join Date: Oct 2001
Location: Coquitlam BC
Posts: 705
ZENYO is on a distinguished road
Did a google and found this
http://beta.experts-exchange.com/Ope...1.html#9006247

I tried it and it works. Basical I created a batch file to login to my ftp site named it ftp1.bat. The I created a second batch file that simply said "ftp -s:ftp1.bat" (without quotations).

-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.


Hope this helps.
__________________
Eat, drink and be merry...
ZENYO is offline   Reply With Quote
Old 09-18-2003, 11:02 AM   #4 (permalink)
Registered User
 
Join Date: Sep 2003
Location: Amityville
Posts: 4
wasabi1980 is on a distinguished road
Thankyou

Thankyou for your help, however, I am still having trouble running this. I have created two files.

In updatenews.bat I have this:
Code:
ftp [-n][-s:ftpscript.cmd]
In ftpscript.cmd I have this:
Code:
FTP
open christopherlaw.com\josh\current\test\blog
username
password
del blog.inc
put C:\Documents and Settings\Josh\Desktop\blog\blog.inc
pause
Can you help me?
__________________
http://www.josheaton.tk
http://www.nosnowinthesouth.tk

Last edited by wasabi1980; 09-18-2003 at 12:14 PM.
wasabi1980 is offline   Reply With Quote
Old 09-18-2003, 12:48 PM   #5 (permalink)
Registered User
 
Join Date: Sep 2003
Location: Amityville
Posts: 4
wasabi1980 is on a distinguished road
Thankyou Everyone for your Help I have FIGURED IT OUT!!!!!!!!!!
__________________
http://www.josheaton.tk
http://www.nosnowinthesouth.tk
wasabi1980 is offline   Reply With Quote
Old 09-18-2003, 05:19 PM   #6 (permalink)
Registered User
 
ZENYO's Avatar
 
Join Date: Oct 2001
Location: Coquitlam BC
Posts: 705
ZENYO is on a distinguished road
What did you figure out? Share with us!
__________________
Eat, drink and be merry...
ZENYO is offline   Reply With Quote
Old 09-18-2003, 07:57 PM   #7 (permalink)
Registered User
 
Join Date: Sep 2003
Location: Amityville
Posts: 4
wasabi1980 is on a distinguished road
ok

here is what I have now:

in update.bat I have:
Code:
@TITLE Uploading, please wait...
@ECHO ................................................................
@ECHO .                                                              .
@ECHO .         Uploading Latest Blog To http://www.josheaton.tk     .
@ECHO .                         http://www.josheaton.tk              .
@ECHO .                                                              .
@ECHO ................................................................
@ECHO .                                          By: Josh Eaton      .
@ECHO ................................................................
@ftp -s:C:\blog\update.txt
pause
and in update.txt I have:
Code:
open christopherlaw.com
username
password
cd public_html
cd josh
cd current
cd test
cd blog
delete blog.inc -q
put C:\blog\blog.inc
@ECHO
@ECHO
@ECHO
@ECHO
@ECHO ................................................................
@ECHO .                                                              .
@ECHO .            Uploaded Latest Blog To http://www.josheaton.tk   .
@ECHO .              http://www.josheaton.tk                         .
@ECHO .                                                              .
@ECHO ................................................................
@ECHO .                                          By: Josh Eaton      .
@ECHO ................................................................
bye
__________________
http://www.josheaton.tk
http://www.nosnowinthesouth.tk
wasabi1980 is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 12:57 AM.