I use the following to FTP a file. However it temporarily creates a text
file on the Desktop that contains the users password. I'm concerned about
the vbs failing sometime and leaving the file for all to see. Is there a way
I could just write it to a string, pass the string to FTP and never create
the text file anywhere?

thanks
LJB

'-----------------------------------------------------------
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")

Path = oShell.SpecialFolders("Desktop")
Order = InputBox("Order Number")

Set oScript = oFSO.CreateTextFile(Path & "\get.txt", True)
With oScript
.WriteLine "open vaxf"
.WriteLine InputBox("UserID")
.WriteLine InputBox("Password")
.WriteLine "cd RPT$DISK:[RPT.RPT_UNT]"
.WriteLine "type ascii"
.WriteLine "get " & Order & "unt.lis """ & Path & "\" & Order & ".txt"""
.WriteLine "bye"
End With

oShell.Run "ftp -s:""" & Path & "\get.txt""", 0, True

oScript.Close
oFSO.DeleteFile Path & "\get.txt", True

Set oScript = Nothing
Set oFSO = Nothing
Set oShell = Nothing

Re: FTP without script file by Clay

Clay
Fri Aug 19 21:13:05 CDT 2005

On Fri, 19 Aug 2005 09:39:27 -0500, "ljb" <.> wrote:

>I use the following to FTP a file. However it temporarily creates a text
>file on the Desktop that contains the users password. I'm concerned about
>the vbs failing sometime and leaving the file for all to see. Is there a way
>I could just write it to a string, pass the string to FTP and never create
>the text file anywhere?

I don't believe it is possible to script the built-in Windows FTP
without using a file, nor to use VBscript without a file (Somebody
please prove me wrong).

You probably already know this, but using regular FTP is not very
secure. I'd try to set up some other mechanism, but if you have to
use FTP then consider using another client that can mask passwords.
Older versions of WS_FTP LE could do this and for free.

Actually, Internet Explorer can mask FTP passwords. Put "ftp://vaxf"
into the address field and then click on "File". Notice there will be
a "Login As" menu pick available.
Clay Calvert
CCalvert@Wanguru.com
Replace "W" with "L"

Re: FTP without script file by Michael

Michael
Fri Aug 19 22:30:18 CDT 2005

> I don't believe it is possible to script the built-in Windows FTP
> without using a file, nor to use VBscript without a file (Somebody
> please prove me wrong).



You can (sort of) via WshShell.Exec to execute ftp.exe, writing commands via
WshScriptExec.StdIn stream and reading responses via WshScriptExec.StdOut...


--
Michael Harris
Microsoft MVP Scripting