Great scripts: FTP.scriptlet and Shell.scriptlet 
Author Message
 Great scripts: FTP.scriptlet and Shell.scriptlet

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)



Wed, 17 Oct 2001 03:00:00 GMT  
 Great scripts: FTP.scriptlet and Shell.scriptlet
I just registered ftp.wsc and shell.wsc per your instruction.  Then I ran
ftptest.vbs.  An error message came up, saying "ActiveX can't create object
shell.wsc"

Perhaps I'm still missing something.  Please advise.


Quote:
> Assuming you have installed the Windows Script Component software you
> have to register the .wsc file (Scriptlet) as a com object which you can
> do by right clicking the .wsc file and selecting the 'Register' option.
> If you don't see the register option then the Script Component software
> is not installed (it is not part of WSH although the WSC download
> includes WSH and scripting engines v5).

> Regards,
> Ian
> WSH FAQ http://wsh.glazier.co.nz/frame.htm

> -----Original Message-----
> From: VBS Learner
> Posted At: 2/05/99 07:17
> Conversation: Great scripts: FTP.scriptlet and Shell.scriptlet
> Subject: Great scripts: FTP.scriptlet and Shell.scriptlet

> Hello Scripters,

> I like those great scripts but how do I get  Jeff's example to run ?

> (Posted from WSH FAQ http://wsh.glazier.co.nz/frame.htm)



Wed, 17 Oct 2001 03:00:00 GMT  
 Great scripts: FTP.scriptlet and Shell.scriptlet

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)



Wed, 17 Oct 2001 03:00:00 GMT  
 Great scripts: FTP.scriptlet and Shell.scriptlet
Michael,

Thanks for all the work! I'll change the environment setting and repost to
Clarence's site as soon as I can.

I've had several e-mails from people who had registration problems because
of the comments Clarence puts at the beginning of all submitted scripts.
I've been meaning to send him an e-mail about this but.... well, I
procrastinated :^)

Since the comments don't really affect 'normal' scripts, I don't think
Clarence is aware of the potential confusion. I'm copying this post to
Clarence so he can take a look at the problem.

Thanks again Michael!

Jeff


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



Wed, 17 Oct 2001 03:00:00 GMT  
 Great scripts: FTP.scriptlet and Shell.scriptlet
Assuming you have installed the Windows Script Component software you
have to register the .wsc file (Scriptlet) as a com object which you can
do by right clicking the .wsc file and selecting the 'Register' option.
If you don't see the register option then the Script Component software
is not installed (it is not part of WSH although the WSC download
includes WSH and scripting engines v5).

Regards,
Ian
WSH FAQ http://wsh.glazier.co.nz/frame.htm

Quote:
-----Original Message-----
From: VBS Learner

Posted At: 2/05/99 07:17
Conversation: Great scripts: FTP.scriptlet and Shell.scriptlet
Subject: Great scripts: FTP.scriptlet and Shell.scriptlet

Hello Scripters,

I like those great scripts but how do I get  Jeff's example to run ?

(Posted from WSH FAQ http://wsh.glazier.co.nz/frame.htm)



Thu, 18 Oct 2001 03:00:00 GMT  
 Great scripts: FTP.scriptlet and Shell.scriptlet
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)



Thu, 18 Oct 2001 03:00:00 GMT  
 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)



Thu, 18 Oct 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Ftp scriptlet control via vbs

2. PBM: Can't create WSDL file from Scriptlet (Windows Script Component)

3. Script to Scriptlet - how ??

4. Scriptlet and HTML Question

5. scriptlet and window object

6. SCRIPTLET.typelib

7. js vs vbs for writing xml scriptlet

8. Server scriptlets

9. Security Bulletin Released for Scriptlet.TypeLib issue

10. scriptlet wizard

11. How to destroy an x-scriptlet object?

12. Javascript Scriptlets

 

 
Powered by phpBB® Forum Software