Re: Include a vbs file into another vbs file




"mr_unreliable" <kindlyReplyToNewsgroup@xxxxxxxxxxx> wrote in message
news:uvJW3K3XIHA.3696@xxxxxxxxxxxxxxxxxxxxxxx
Jake wrote:
What is the syntax for including a vbs file in this scenario?


Jake, if you are willing to compromise your requirements
a bit, and use a "wsf" file instead of a vbs file, then
you may include other scripts with a "one-liner".
For example:

--- <code> ---
<?XML version="1.0" standalone="yes" encoding="iso-8859-1" ?>
<job id="demoWSF">
<comment> This "includes" the cbt hookingini code... </comment>
<script language="VBScript" src="incOpenFileDlgDeclarations.vbs"
></script>

<script language="VBScript">
<![CDATA[
' ===================
' your script goes here...
' ===================


]]>
</script>
</job>
--- </code> ---

As usual, you can find the documentation for a "wsf" file
in the scripting documentation.

Good advice to use a .wsf file. Our logon script is a .wsf that uses the
script tag to include files containing utility functions. We also use a
version of the "IncludeFile" subroutine to allow some site-specific
customization. One problem with IncludeFile is that routines loaded in that
manner can be difficult to debug. A further issue that we have been advised
of by a consultant from Microsoft is that there can be a significant amount
of overhead in terms of network traffic associated with processing separate
files located in the NETLOGON share, especially those that are in deeply
nested folder structures. If I had known that when I wrote the script, I
would have made it a bit more efficient by reducing the number of separate
files and simplifying how they are stored.

Anyway, it is not a problem for most of our users, but those coming in
through vpn connections and at sites with no DC wind up spending longer
waiting for the script to finish than they should have to.

/Al

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)







.



Relevant Pages

  • Re: WSH not returning exit code <> 0 when script aborts, why?
    ... involved for a *.wsf file... ... scrobj.dll which serves as the inner host. ... that creates the instances of the script engines. ... ambiguous error line problem in a multiple script element *.wsf that I ...
    (microsoft.public.scripting.wsh)
  • Re: Incude statement - is there such a thing?
    ... > I can't imagine any memory usage issues. ... Sounds like you are thinking of wsc more than wsf... ... > other script files (as the Docs often suggest to be ... The .wsf format allows you to specify relative file paths to the included ...
    (microsoft.public.scripting.vbscript)
  • Re: WSF src file forward references
    ... Say I have two JScript files A.js and B.js in a wsf job ... This is because the script run-time does not yet know about ...
    (microsoft.public.scripting.wsh)
  • Re: Type of Script?
    ... Can someone tell me what type of script this is? ... It's a *.wsf format script, just name it with a *.wsf extension. ... pass = "MyPassword" ' password to use with username above ... Sub RdpCall ...
    (microsoft.public.scripting.vbscript)
  • Re: Hwo can I get the job id from within a script?
    ... > files) - well except for the essential ability to include multiple script ... I don't know about argument processing, per se, but one other thing the .wsf ... >> bruce cartland wrote: ... many shortcomings of the WSF file format (IIRC including this ...
    (microsoft.public.scripting.wsh)

Loading