I often need to upload single files to an FTP server.
I am trying to create a script that will automate this process, and have
been investigating VBScript to do this job.
I know a little about FTP.exe with the -s: tag to make it run scripts.
Ideally what I would like is for the script to open a box where I could drag
the file, and from there it would upload it.
So structurally, the process goes: Create a variable, set this variable to
contain the file directory\name, then it would create the script to enter
into FTP.exe, and run it.
Can anyone give me any hints on the best way to go about it? I'd be most
grateful.
Scott
Ray at work
"scott" <vote...@cathsDOTco.uk> wrote in message
news:vp0gtjp...@corp.supernews.com...
Actually, that would be perfect. I couldn't think of a way to get the name
of the file that I wanted to send into the script though....
@echo off
set f="%*"
@echo Generating FTP session...
@echo open XXX.XXX.XXX.XXX>c:\up.ftp
@echo user USERNAME>>c:\up.ftp
@echo PASSWORD>>c:\up.ftp
@echo type ascii>>c:\up.ftp
@echo put %f%>>c:\up.ftp
@echo close>>c:\up.ftp
@echo quit>>c:\up.ftp
@echo Connection to FTP Server
ftp.exe -v -n -s:C:\up.ftp
@echo fine
Then merge in a .reg file with these contents:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\uploadMe]
[HKEY_CLASSES_ROOT\*\shell\uploadMe\command]
@="D:\\WINDOWS\\ftpit.bat \"%1\""
Note that this is for if you have a ftpit.bat file in D:\Windows. Adjust as
needed. Also, I guess to handle ascii vs. binary file transfer (or image
type for some hosts), I'm not sure what you'd do. You could have a right
click option for each transfer type, or you could have it decided based on
known file extensions, and if uknown, default to binary.
Ray at work
"scott" <vote...@cathsDOTco.uk> wrote in message
news:vp0j59m...@corp.supernews.com...
Works a treat I must say :-). Thank you!
Only had to change one thing:
> set f="%*"
Had to take the brackets off "%*", as it was failing to upload double
bracketed files.
Other than that, work of mastery, thanks!! :-)
Scott.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:OqUVS1Ol...@TK2MSFTNGP11.phx.gbl...
Ray at work
"scott" <vote...@cathsDOTco.uk> wrote in message
news:vp0mj47...@corp.supernews.com...
--
Bill James
Microsoft MVP - Shell/User
Win9x VBScript Utilities » www.billsway.com/vbspage/
Windows Tweaks & Tips » www.billsway.com/notes_public/
"scott" <vote...@cathsDOTco.uk> wrote in message news:vp0gtjp...@corp.supernews.com...