First up, preperation. I have a diretory on my HDD called scripts - it just keeps things nice and tidy, I know my scripts can create/delete all sorts of non .bat files safely...
So I first made this script - to be saved as c:\scripts\ftpme.bat
Code: Select all
echo off
rem Script to upload using the Windows FTP client.
rem Takes a single paramter (filename) and uploads it
rem to the hardcoded FTP site.
set site=
set dest=
set user=
set pass=
echo "Uploading %1"
echo open %site% > ftpscript.scr
echo user >> ftpscript.scr
echo %user% >> ftpscript.scr
echo %pass% >> ftpscript.scr
echo cd %dest% >> ftpscript.scr
echo put %1 >> ftpscript.scr
echo quit >> ftpscript.scr
ftp -n -s:ftpscript.scr
del ftpscript.scr
pause
The site is the login site, dest is the directory, user and pass are exactly that.
Now I need it to run from in TextPad to upload the file currently on show, so I make it a TextPad "tool":
- + Menu - Configure->Preferences and select tools (bottom left)
+ Add (top right) a PROGAM and browse to the newly created batch file (c:\scripts\ftpme.bat)
+ Click APPLY
+ Expand the tools tree and select FTPme
+ The command will look like "C:\Scripts\ftpme.bat"
+ Add the parameter: "$DOSFile"
+ I have "Save all docs first" selected and an audio warning...
+ Click OK
We can now upload the current file by going to the Menu Tools->ftpme - or Ctrl-x (where x is the tool number)
To add an icon to textpad simply RHC on the menu, customise and drag the relevant icon from the tools array. It looks pants but it works...
HTH someone...
Bob
LIMITATIONS:
Fixed destination - you could have several batch files if you wanted a couple of destinations.
Active file only...
Security*
Icon looks pants.
* Let's face it FTP isn't secure anyway, and this is on your local machine - do you really care that this is in plaintext?