
Great scripts: FTP.scriptlet and Shell.scriptlet
The ftp.sct source code I have (downloaded on 5/1) has
CreateObject("Shell.Scriptlet").
The .sct and .wsc extensions are equivalent. The .wsc extension was added
after the final beta I believe to reflect the new name of Windows Script
Components.
--
Michael Harris
Thank you Michael. The information you provided is very helpful.
Additionally, I found that in the File FTP.sct, I need to change the line
that says CreateObject("Shell.wsc") to read CreateObject("Shell.Scriptlet").
On a related subject, can anyone answer the question why .wsc and .sct
appear to refer to Scriptlet type ?
Anyway, these scriptlets work great and I got a very good exercise out of
them. Thank you all once again.
Enoch
Quote:
> I just downloaded and installed these. I had to edit them and remove the
> comments that preceded the intital XML directive before they would
register
> as .sct files. When I ran the sample script, I got the same non-response.
> A little debugging revealed that in the .sct that defines the
FTP.Scriptlet,
> the line
> Set WshSysEnv = WshShell.Environment("SYSTEM")
> needs to be changed to
> Set WshSysEnv = WshShell.Environment("PROCESS")
> PROCESS is the only environment that's valid for both WinNT and Win9x.
What
> happens on a Win9x box is that the query for the WINDIR environment
variable
> comes back blank and the ftp command string built starts with
> \ftp.exe
> instead of
> C:\Windows\ftp.exe
> Since this won't execute, the command output is empty. Once I fixed this,
> it works fine. I didn't try to figure out why the WScript.Echo at the end
> doesn't at least pop up an empty message.
> PS - I cc'd this post ro Jeff Mastry.
> --
> Michael Harris
> Hello Scripters,
> I like those great scripts but how do I get Jeff's example to run ?
> I tried Jeff Mastry's example ftp and I was able to get the Internet
> Explorer 5 to come up.
> This is how I started it from the DOS prompt:
> Start ftptest.vbs
> IE was trying to get access ftp://ftptest.vbs/ as a site. Did I miss
> something ?
> The script that I tried is listed below:
> 'Name: Jeff Mastry
> 'Script_Type: scriptlet
> 'keywords: ftp, XML,
> 'Comment:
> 'This is a scriptlet that allows you to easily transfer files via FTP
> without an external control.
> 'Script:
> 'Sample useage:
> Set ftp = WScript.CreateObject("FTP.Scriptlet")
> ftp.Host = "ftp.microsoft.com"
> ftp.LocalDir = "C:\Downloads"
> ftp.RemoteDir = "/some/where"
> ftp.Download "*.vbs"
> WScript.Echo ftp.ReturnCode & vbCRLF & ftp.Output
> ' Note that this scriptlet requires one of my other scriptlets
> ' called "Shell.Scriptlet" (uploading that one next)