×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Can functions from mutiple VBScripts be referenced in a single .wsf file?

Can functions from mutiple VBScripts be referenced in a single .wsf file?

Can functions from mutiple VBScripts be referenced in a single .wsf file?

(OP)
Hi,

Can we access several .vbs files, in a single .wsf? Just like we can interact with functions multiple languages, I was wondering if we could use more than one VBScript in the same job.

RE: Can functions from mutiple VBScripts be referenced in a single .wsf file?

(OP)
Looks like the answer is yes. This is an example with different scripts, but the same job.

Get_A() is taken from TEST_01.vbs, while Get_B() is taken from TEST_02.vbs.


Test.wsf

CODE --> VBScript

<job id="Test">
	<script language="VBScript" src="TEST_01.vbs">
	</script>
	<script language="VBScript" src="TEST_02.vbs">
	</script>
	<script language="VBScript">
		Option Explicit
		Dim A_s
		Dim B_s
		A_s = Get_A()
		B_s = Get_B()
		MsgBox( "Finished" )
	</script>
</job> 

Test_01.vbs

CODE --> VBScript

Option Explicit

Function Get_A()
Dim A_s
A_s = "A"
Get_A = A_s
End Function 



Test_02.vbs

CODE --> VBScript

Option Explicit

Function Get_B()
Dim B_s
B_s = "B"
Get_B = B_s
End Function 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close