I have created HTA file which has userform to collect data from the user.
I am calling this HTA file from batch file.
After reading user inputs, i want input values to be passed to batch file from HTA.
Is is possible to achieve?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can have the HTA file return the values to the batch file, but it cannot do it directly. You have to use Javascript to create a text file with the user provided values, then your batch file can process the values. Here’s a site with several methods listed to read and write text files:
http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm
Using one of these, I created a very simple example to demonstrate how this is done:
SimpleForm.hta
Now the batch file:
You will need to deal with the complexities of the user typing in the delimiter character (a tilde in my example) into one of the text fields and throwing off parameter parsing of the
forstatement. You could use an obscure character that the user won’t type for instance.