Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Passing Variables from a VBScript to an HTA

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,62886
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Passing Variables from a VBScript to an HTA
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Passing Variables from a VBScript to an HTA - 7/29/2008 2:05:54 AM   
  chiltz

 

Posts: 76
Score: 0
Joined: 6/13/2007
Status: offline
Hey All you Guru's,

I built a vb script for the purpose of passing variables to an HTA.  The intent is that multiple HTA's will be open depending on the number of lines in an xls spreadhseet. The spreadsheet contains the data that will go into the variables.  VBS opens the spreadsheet, lets you enter data, then passes that data to HTA via commandline variables. 

Now for the problem.  Inorder for the commandline to work properly, I have to wrap the variables in double quotes.  When I do this, I get "unexpected end of statement errors".  If I wrap the variables in single quotes, then the path is invalid cuz it has spaces.  Anybody know how I can use double quotes in the below for loop?  Specifically in the Shell.Run command.


      



Complete script is below for refrence:


      

< Message edited by chiltz -- 7/29/2008 2:07:53 AM >
 
 
Post #: 1
 
 RE: Passing Variables from a VBScript to an HTA - 7/29/2008 2:21:46 AM   
  dm_4ever


Posts: 2669
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Man this looks messy but try

"%comspec% /k """ & htafile & """ """ & ArgCH & """ """ & ArgNH & """ """ & ArgCIP & """ """ & ArgNIP & """ """ & ArgSM & """ """ & ArgGW & """"

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to chiltz)
 
 
Post #: 2
 
 RE: Passing Variables from a VBScript to an HTA - 7/29/2008 4:44:24 AM   
  chiltz

 

Posts: 76
Score: 0
Joined: 6/13/2007
Status: offline
Below is a working version of the script.  The key is to use the variable version of double quotes "chr(34)" instead of the actual double quotes.  For those wondering how to make use of those varabiles in the HTA, make a "Windows_Onload" sub and direct the variables as you see fit...for me, I am writing them from the array into another variable inside the HTA.


      

(in reply to chiltz)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Passing Variables from a VBScript to an HTA Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts