Referencing external scripts in VB6 (similar to hta)

Apologies for the title, let me explain:
I am designing a slightly prettier front-end naming system for WinPE/SCCM. I am looking at doing this in VB6.  The script I am recreating is attached. What I would like to know is how I reference "X:\ZTIUtility.vbs" as below within VB6? Without reference to this script, the environment vars aren't passed during the build.
Thank you
<job id="ZTIPromptForComputerName">
   <script language="VBScript" src="X:\ZTIUtility.vbs"/>
   <script language="VBScript">
Option Explicit
 
Dim numCount
Dim strComputerName
Dim strComputerOU
Dim objOSD
 
Do While numCount = 0
    strComputerName = InputBox ("Please enter a name for the new computer:","New Computer Name","",10,10)
    If strComputerName = "" Then
        Wscript.Echo "You must enter a computer name."
    Else
        oEnvironment.Item("OSDNEWMACHINENAME") = strComputerName
        oEnvironment.Item("OSDCOMPUTERNAME") = strComputerName
        Exit Do
    End If
 
Loop
 
Do While numCount = 0
    strComputerOU = InputBox ("Please enter OU for the new computer:","COMPUTER OU","",10,10)
    If strComputerOU = "" Then
        Wscript.Echo "You must enter an OU name."
    Else
        oEnvironment.Item("MACHINEOBJECTOU") = "OU=" & strComputerOU & ",OU=CaroeCourt Computers,DC=CaroeCourt,DC=Net"
	oEnvironment.Item("OSDDomainOUName") = "OU=" & strComputerOU & ",OU=CaroeCourt Computers,DC=CaroeCourt,DC=Net"
	oEnvironment.Item("OSDJoinDomainOUName") = "OU=" & strComputerOU & ",OU=CaroeCourt Computers,DC=CaroeCourt,DC=Net"
        Exit Do
    End If
Loop
   </script>
</job>

Open in new window

NewsInternationalLtdAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jjardineCommented:
Have a look at this article http://www.vb-helper.com/howto_execute_vbscript.html    it might give some help towards the MSScriptcontrol
0
NewsInternationalLtdAuthor Commented:
Still not clear on this.
Should I add the vbscript as an object?
0
jjardineCommented:
I believe that you would instantiate the msscriptcontrol object and then add the vbscript text into that control to be able to execute it.  I do not know if you will be able to pull variables and the like into your vb6 program.  this just allows running vbs scripts.  
0
NewsInternationalLtdAuthor Commented:
I have re-written this as an HTA which now works fine. I don't think WinPE works properly with vb6.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.