?
Solved

VBScript: How do I import another VBS file as an include?

Posted on 2005-03-02
4
Medium Priority
?
714 Views
Last Modified: 2008-02-01
VBScript: How do I import another VBS file as an include?

If there is a uniform way to do it, I would like to know how? If not, I would like to know if there is a back door way to perform this. Thanks.
0
Comment
Question by:HackLife
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Author Comment

by:HackLife
ID: 13442366
Well, I figured it out, but I still would like to give the points away. I need to understand what are the difference between these:

Eval

ExecuteGlobal

Execute

and how to use them.

I found this in another board:

Include "somecode.vbs"

Sub Include(sCodeFile)
  Dim sCode
  with createobject("scripting.filesystemobject")
    sCode = .OpenTextFile(sCodeFile).ReadAll
  End With
  ExecuteGlobal sCode
End Sub
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 13442391
Why not just set the vbsfile as a Constant:

Dim wshell

Const VBSFILE = "Somefile.vbs"

Set wshell = CreateObject("WScript.Shell")

wshell.Run VBSFILE

Set wshell = Nothing
0
 
LVL 4

Accepted Solution

by:
lotsofish earned 1000 total points
ID: 13442710
0
 
LVL 4

Author Comment

by:HackLife
ID: 13443183
Because I'm including classes and "run" will not help any.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question