Include files and WSH - a newbie question 
Author Message
 Include files and WSH - a newbie question

Well trying to understand the posabilities in wsh, I'd very much like to
things as I do them in my ASP code - building up a component based
structure (We Danes call it a LEGO?-model)

So please tell me if the following example is valid, or do I have to
include my file in every job

<package>
<SCRIPT LANGUAGE="VBScript" SRC="include.vbs"></SCRIPT>
<job ID=first>
<SCRIPT LANGUAGE="VBScript">
        ' First part that uses something from include.vbs
</SCRIPT>
</job>
<job ID=second>
<SCRIPT LANGUAGE="VBScript">
        ' Second part that uses something from include.vbs
</SCRIPT>
</job>
</package>

/Thomas



Sat, 07 Dec 2002 03:00:00 GMT  
 Include files and WSH - a newbie question
You need the "include" in each of job the elements which are completely independent of each other.
Element and attribute names are also case sensitive...

<package>
<job id="first">
<script language="vbscript" src="include.vbs"></script>
<script language="vbscript">
' first part that uses something from include.vbs
</script>
</job>
<job id="second">
<script language="vbscript" src="include.vbs"></script>
<script language="vbscript">
' second part that uses something from include.vbs
</script>
</job>
</package>

--
Michael Harris
MVP Scripting


Well trying to understand the posabilities in wsh, I'd very much like to
things as I do them in my ASP code - building up a component based
structure (We Danes call it a LEGO?-model)

So please tell me if the following example is valid, or do I have to
include my file in every job

<package>
<SCRIPT LANGUAGE="VBScript" SRC="include.vbs"></SCRIPT>
<job ID=first>
<SCRIPT LANGUAGE="VBScript">
' First part that uses something from include.vbs
</SCRIPT>
</job>
<job ID=second>
<SCRIPT LANGUAGE="VBScript">
' Second part that uses something from include.vbs
</SCRIPT>
</job>
</package>

/Thomas



Sat, 07 Dec 2002 03:00:00 GMT  
 Include files and WSH - a newbie question

Independance is a good thing, but in this case it's a little too much
of a good thing. --) It's *very* frustrating that <object>,
<reference> and <resource> can't be also be children of <package>.


: You need the "include" in each of job the elements which are
completely independent of each other.
: Element and attribute names are also case sensitive...
:
: <package>
: <job id="first">
: <script language="vbscript" src="include.vbs"></script>
: <script language="vbscript">
: ' first part that uses something from include.vbs
: </script>
: </job>
: <job id="second">
: <script language="vbscript" src="include.vbs"></script>
: <script language="vbscript">
: ' second part that uses something from include.vbs
: </script>
: </job>
: </package>
:
: --
: Michael Harris
: MVP Scripting
:
:


: Well trying to understand the posabilities in wsh, I'd very much
like to
: things as I do them in my ASP code - building up a component based
: structure (We Danes call it a LEGO?-model)
:
: So please tell me if the following example is valid, or do I have to
: include my file in every job
:
: <package>
: <SCRIPT LANGUAGE="VBScript" SRC="include.vbs"></SCRIPT>
: <job ID=first>
: <SCRIPT LANGUAGE="VBScript">
: ' First part that uses something from include.vbs
: </SCRIPT>
: </job>
: <job ID=second>
: <SCRIPT LANGUAGE="VBScript">
: ' Second part that uses something from include.vbs
: </SCRIPT>
: </job>
: </package>
:
: /Thomas
:



Sat, 07 Dec 2002 03:00:00 GMT  
 Include files and WSH - a newbie question
It's on the "wish list" (at least for <object>)...

--
Michael Harris
MVP Scripting


Independance is a good thing, but in this case it's a little too much
of a good thing. --) It's *very* frustrating that <object>,
<reference> and <resource> can't be also be children of <package>.


: You need the "include" in each of job the elements which are
completely independent of each other.
: Element and attribute names are also case sensitive...
:
: <package>
: <job id="first">
: <script language="vbscript" src="include.vbs"></script>
: <script language="vbscript">
: ' first part that uses something from include.vbs
: </script>
: </job>
: <job id="second">
: <script language="vbscript" src="include.vbs"></script>
: <script language="vbscript">
: ' second part that uses something from include.vbs
: </script>
: </job>
: </package>
:
: --
: Michael Harris
: MVP Scripting
:
:


: Well trying to understand the posabilities in wsh, I'd very much
like to
: things as I do them in my ASP code - building up a component based
: structure (We Danes call it a LEGO?-model)
:
: So please tell me if the following example is valid, or do I have to
: include my file in every job
:
: <package>
: <SCRIPT LANGUAGE="VBScript" SRC="include.vbs"></SCRIPT>
: <job ID=first>
: <SCRIPT LANGUAGE="VBScript">
: ' First part that uses something from include.vbs
: </SCRIPT>
: </job>
: <job ID=second>
: <SCRIPT LANGUAGE="VBScript">
: ' Second part that uses something from include.vbs
: </SCRIPT>
: </job>
: </package>
:
: /Thomas
:



Sat, 07 Dec 2002 03:00:00 GMT  
 Include files and WSH - a newbie question
It is valid (AFAIK). Package can contain many jobs, jobs can contain many
scripts.

--
Dominic



Sat, 07 Dec 2002 03:00:00 GMT  
 Include files and WSH - a newbie question
It was a sunny day, when Michael Harris stumbled into
microsoft.public.scripting.wsh

Quote:
>You need the "include" in each of job the elements which are completely
>independent of each other. Element and attribute names are also case
>sensitive...

Allrighty then...

But can I include other wsh files?

Like
<package>
<job id="first">
<script language="vbscript" src="include.wsh"></script>
<script language="vbscript">
' first part that uses something from include.wsh
</script>
</job>
<job id="second">
<script language="vbscript" src="include.wsh"></script>
<script language="vbscript">
' second part that uses something from include.wsh
</script>
</job>
</package>

It would make things easier, when I only have to do my work in one place
like Visual InterDev.

/Thomas



Sun, 08 Dec 2002 03:00:00 GMT  
 Include files and WSH - a newbie question
??? <script language="vbscript" src="include.wsh"></script> ???

I assume you meant src="include.wsf" -- a .wsh file is an ini-style configuration file.

In any case the answer is no.  All that the included file can contain is source that is valid within
<script></script> tags, the same as if you typed the code in yourself...

--
Michael Harris
MVP Scripting


It was a sunny day, when Michael Harris stumbled into
microsoft.public.scripting.wsh

Quote:
>You need the "include" in each of job the elements which are completely
>independent of each other. Element and attribute names are also case
>sensitive...

Allrighty then...

But can I include other wsh files?

Like
<package>
<job id="first">
<script language="vbscript" src="include.wsh"></script>
<script language="vbscript">
' first part that uses something from include.wsh
</script>
</job>
<job id="second">
<script language="vbscript" src="include.wsh"></script>
<script language="vbscript">
' second part that uses something from include.wsh
</script>
</job>
</package>

It would make things easier, when I only have to do my work in one place
like Visual InterDev.

/Thomas



Sun, 08 Dec 2002 03:00:00 GMT  
 Include files and WSH - a newbie question
It was a sunny day, when Michael Harris stumbled into
microsoft.public.scripting.wsh

Quote:
>??? <script language="vbscript" src="include.wsh"></script> ???

>I assume you meant src="include.wsf" -- a .wsh file is an ini-style
>configuration file.

That's right. A stated in the subject it is still a bit new to, even though
I come from several years of ASP.

Since you brought it up, how do I make a .wsh file that executes a specific
job in a .wsf file, from the help file I got this idea, but it doesn't seem
to work quite all right.

[ScriptFile]
Path=alljobs.wsf //Job:firstjob
[Options]
Timeout=0
DisplayLogo=1
BatchMode=0

/Thomas



Sun, 08 Dec 2002 03:00:00 GMT  
 Include files and WSH - a newbie question
You can't via a .wsh file (at least if you can it isn't documented ;-).  Just create a normal
Windows shortcut (.lnk) file instead.

I believe the .wsh file format *may* be deprecated in the next release.  In other words there may be
other ways to do the same thing (and probably more) that the .wsh files do via the .wsf xml format.

--
Michael Harris
MVP Scripting


It was a sunny day, when Michael Harris stumbled into
microsoft.public.scripting.wsh

Quote:
>??? <script language="vbscript" src="include.wsh"></script> ???

>I assume you meant src="include.wsf" -- a .wsh file is an ini-style
>configuration file.

That's right. A stated in the subject it is still a bit new to, even though
I come from several years of ASP.

Since you brought it up, how do I make a .wsh file that executes a specific
job in a .wsf file, from the help file I got this idea, but it doesn't seem
to work quite all right.

[ScriptFile]
Path=alljobs.wsf file://Job:firstjob
[Options]
Timeout=0
DisplayLogo=1
BatchMode=0

/Thomas



Mon, 09 Dec 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Includes and Web Naviagation -Newbie question-

2. Can I include other file into WSH file?

3. Can I include other file into WSH file?

4. Newbie WSH question Network mappings

5. Newbie question about WSH

6. ADO and WSH (Newbie Question)

7. Newbie question: Time source via WSH

8. Newbie Questions about WSH

9. newbie question about WSH

10. Newbie WSH Remote Registry question

11. Include JavaScript file in another include file

12. how do i include a 2nd wsh file

 

 
Powered by phpBB® Forum Software