473,394 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to not-quite-automate an FTP in WinXP

8,435 Expert 8TB
Hi all.

If necessary I'll repost this in the Windows forum, but I thought this would be a good place to hit a fair cross-section of the community. Besides, anyone can see that all the best brains post here. ;-)

I have a bit of a problem with scripting an FTP under Windows XP, and was hoping someone can shed some light on it.

I'm quite familiar with DOS batch files, and reasonably comfortable with FTP. I have a bunch of files that I generally download to my PC each morning. I generally start by copying a bunch of commands from a text file to the clipboard, then fire up the vanilla Windows FTP client and manually log on to the FTP server. Then I paste, sit back and watch the show.

So far, so good.

But I'm going on leave for a few weeks, and need to automate the process for someone else to run while I'm away, as some of the files will be deleted before I get back. I can set up a batch file they can open to FTP to the appropriate server and run a script, no worries.

BUT!!!

How can I allow the user to provide their user ID and password to log on? Hard-coding either mine or theirs into the file is out of the question. I have tried all sorts of combinations of auto-logon turned on and off, user and pass commands in the script file, and so on. But it seems as though I can basically either code the details in the file, or make the user do everything.

I need a way to let the FTP server stop and prompt the user (as normal) for their password (and maybe ID, but that's not so important) before continuing with the script.

If necessary, I'll write up instructions for them to paste the commands across like I've been doing, but would really prefer to automate it.

TIA

Tagline: I never muss the obvious.
Nov 28 '06 #1
10 2154
NeoPa
32,556 Expert Mod 16PB
Killer,

I've done lots of work in this area but I'm on holiday tomorrow and my link into the office is down.
Mostly I've automated it fully though, rather than allowing creds to be entered.

For the full SP on the FTP command, though, go to Windows Explorer (Windows-E) and select 'Help and Support centre' from the Help menu.
In there search for FTP & select the option FTP from the found list.
There's not much it doesn't tell you.

Best of luck and let me know if you're still having problems on Thursday.

-Ade.
Nov 28 '06 #2
Killer42
8,435 Expert 8TB
I've already checked the doco for FTP. Automating it is easy. The problem is that there is part of the process that I don't want to automate, as I still need to leave the security intact.

P.S. I've also searched Microsoft's website, thescripts, and a general Google search, without success.
Nov 28 '06 #3
NeoPa
32,556 Expert Mod 16PB
I've already checked the doco for FTP. Automating it is easy. The problem is that there is part of the process that I don't want to automate, as I still need to leave the security intact.

P.S. I've also searched Microsoft's website, thescripts, and a general Google search, without success.
Ok ok - I still need my head - don't bite it off.
I did read the original post but hadn't realised you'd checked into it that far already.
I can maybe do some more testing if I get time on Thursday for you.
Nov 28 '06 #4
Killer42
8,435 Expert 8TB
Ok ok - I still need my head - don't bite it off.
I did read the original post but hadn't realised you'd checked into it that far already.
I can maybe do some more testing if I get time on Thursday for you.
Cool, thanks. I've still got a couple of weeks.

And I wasn't intending to be snappy. :-(

I did forget to mention that I'd searched all over the place.
Nov 29 '06 #5
NeoPa
32,556 Expert Mod 16PB
You know that's not a problem Killer - I was just having some fun ;).
Nov 29 '06 #6
NeoPa
32,556 Expert Mod 16PB
Killer,

I have a command file (D:\Vecta\VectaBeta.Cmd) which executes the FTP job.
Expand|Select|Wrap|Line Numbers
  1. FTP.Exe -n -s:D:\Vecta\VectaBeta.Ftp -w:16384 blinnk.net
I have this scheduled in the last step of my SQL Server job which produces the data file.
Expand|Select|Wrap|Line Numbers
  1. At 19:00 "D:\Vecta\VectaBeta.Cmd"
The job itself (D:\Vecta\VectaBeta.Ftp) includes the connection security information.
Expand|Select|Wrap|Line Numbers
  1. user {LogonID} {Password}
  2. binary
  3. lcd D:\MSSQL\Backup
  4. delete StatPlusVecta.Zip
  5. bell
  6. put StatPlusVecta.Zip
  7. delete VectaSTP.Bak
  8. bell
  9. put VectaSTP.Bak
  10. bye
I'm pretty sure that this will prompt you for information if you either don't pass the complete set of creds or if you don't include the 'user' line at all.
Dec 5 '06 #7
sashi
1,754 Expert 1GB
Hi Killer,

I came across few links that deals with FTP scripts, kindly refer to below attached links, hope it provides some solutions. Goos luck & Take care.

http://support.microsoft.com/kb/96269
http://www.simotime.com/ftp4cmd1.htm
http://www.ericphelps.com/batch/samples/samples.htm
FTP - Script
Dec 5 '06 #8
Killer42
8,435 Expert 8TB
...
I'm pretty sure that this will prompt you for information if you either don't pass the complete set of creds or if you don't include the 'user' line at all.
What I've found is that rather than stopping to prompt the user, it simply takes the next piece of info from the file.

So basically, I can either automate if fully by sticking a user ID and password in the file (ugh!), or I can make the user drive it themselves, but can't seem to combine the two.

Thanks, anyway. I'll check out sashi's links, but so far things are not looking promising.
Dec 5 '06 #9
Killer42
8,435 Expert 8TB
...I came across few links that deals with FTP scripts...
Thanks, sashi - I'll check them out.
Dec 5 '06 #10
Killer42
8,435 Expert 8TB
Thanks, sashi - I'll check them out.
Well, I've had a look.

As I suspected, there's a lot of fascinating info there (now bookmarked for later reading), but not what I was looking for.

I don't think it's possible. All samples and explanations assume that by scripting, you will want to automate the logon by including user ID and password in the script. Argh!

The batch file which accepts user input to an environment variable looked like a chance, until I tried it out and found that it doesn't work under XP. (At least, I assume XP was the problem - it looks as though FC now refuses to accept CON as an input file.)

Thanks everyone, but I might as well give up on that line of attack - I have to have this working in a couple of days. Think I'll just set up instructions for the user to log on, then copy and paste the command stream.
Dec 5 '06 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Phil Powell | last post by:
<b>Agency 4</b> <input type="radio" name="permission" value="1" checked> Yes <input type="radio" name="permission" value="0" > No <br> <b>Agency 5</b> <input type="radio" name="permission"...
52
by: Tony Marston | last post by:
Several months ago I started a thread with the title "What is/is not considered to be good OO programming" which started a long and interesting discussion. I have condensed the arguments into a...
5
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
33
by: Bob | last post by:
When I first started in web programming (I left it for more than a few years) I programmed my web pages in C and a little perl. Now that I have a need to come back to web programming I find that...
16
by: Andrea A | last post by:
Hi, i'm developing a website that will have an huge amount of visitors a day --> it will be a contest with 100.000$ of prize. I'm concerning about using a template class (and which one do you...
13
by: Bruce A. Julseth | last post by:
I'm a newbie to PHP and am have problems getting simple PHP page (php_test_page.php) to display correctly. The page is: <html> <body>
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
9
by: joealey2003 | last post by:
Hi all... A simple mail example like... <? mail("acco...@yahoo.com","Subject of Message","Message"); ?> does not work to yahoo or spymac.com, but the same works to gmail and other servers.
7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
16
by: Gonçalo Rodrigues | last post by:
Hi, Consider the following class: >>> class Test(object): .... def __init__(self, obj): .... self.__obj = obj .... def __getattr__(self, name): .... return getattr(self.__obj, name)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.