Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 682

calling another vbs using variable folder name in script

$
0
0
I have an hta which when a button is pressed calls another vbs
This worked using the real folder path, but I have changed it so it's a variable:

staff_path= "\\servername\applications\backgrounds\STAFF_SUBJECT_MENUS"


Now this line works fine to set the background picture for the hta:


<BODY BACKGROUND=staff_path&"\"&"admin_resources.jpg">

But this line doesn't when it tries to run a vbs:

Sub assist
Set objShell = CreateObject("WScript.Shell")
result = objShell.run staff_path&"\"&msra_prompt.vbs
End Sub

I get "expected end od statement"

Original line which worked was:

Sub assist
Set objShell = CreateObject("WScript.Shell")
result = objShell.run("""\\servername\applications\backgrounds\STAFF_SUBJECT_MENUS\msra_prompt.vbs""")
End Sub

Can someone please give me a clue?
Thanks
Dan

Viewing all articles
Browse latest Browse all 682

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>