how to get values through javascript and pasted in batch file

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Oct 2008
Posts: 22
Reputation: mlohokare is an unknown quantity at this point 
Solved Threads: 0
mlohokare mlohokare is offline Offline
Newbie Poster

how to get values through javascript and pasted in batch file

 
0
  #1
Apr 27th, 2009
Hi all,

1] I have to create one html file which uses javascript.
2] HTML page can be accessed by user and can fill the;
[A] Folder path along with file name
3] There will be a button, after click on that a batch file [already present but without any values] will run with new values provided by javascript.
4] Through that batch file i will process XML to HTML conversion.
5] After completion of batch 1 message should be given as "Process Over"

Purpose of this -
User will not interact directly with batch file. He/ She will just paste the path and file name and click on button.
Rest of the things will done in background.
User can see only output, without interrupting the actual process.

My HTML looks like below,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome to this project</title>
</head>
<body>
<h1 style="text-align:center;">Wel-come</h1>
<hr />
<table>
	<tr>
		<td>Please enter file name here</td>
		<td><input name="file_name" type="text" size="50" maxlength="50" id="fn1" /></td>
	</tr>
	<tr>
		<td>Please enter folder path here</td>
		<td><input name="folder_name" type="text" size="50" maxlength="20" id="fldn1"  /></td>
	</tr>
</table>
</body>
</html>

Please suggest is this possible? if yes how it can be done?
Any help will be appreciated as I am struggling this very much.

Cheers,
Mahesh
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 220
Reputation: mail2saion is an unknown quantity at this point 
Solved Threads: 33
mail2saion's Avatar
mail2saion mail2saion is offline Offline
Posting Whiz in Training

Re: how to get values through javascript and pasted in batch file

 
0
  #2
Apr 27th, 2009
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. fh = fopen(getScriptPath(), 0); // Open the file for reading
  2. if(fh!=-1) // If the file has been successfully opened
  3. {
  4. length = flength(fh); // Get the length of the file
  5. str = fread(fh, length); // Read in the entire file so you can do your job from here
  6. fclose(fh); // Close the file
  7.  
  8. // Display the contents of the file
  9. write(str);
  10. }
MARK AS SOLVED if its help you.

REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 857
Reputation: Airshow is on a distinguished road 
Solved Threads: 122
Airshow's Avatar
Airshow Airshow is offline Offline
Practically a Posting Shark

Re: how to get values through javascript and pasted in batch file

 
0
  #3
Apr 27th, 2009
Mlohokare,

Is the processing client-side (Javascript) or do you go server-side? Similarly, where is the source file; server-side or client-side?

If server-side is involved, then what are you running there: php, jsp, asp, cgi etc.?

It's not possible to answer your question witout knowing the basic architecture.

Airshow
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 22
Reputation: mlohokare is an unknown quantity at this point 
Solved Threads: 0
mlohokare mlohokare is offline Offline
Newbie Poster

Re: how to get values through javascript and pasted in batch file

 
0
  #4
Apr 28th, 2009
Hi All,

Thanks for your instant replies.

Basically I am developing a small system which includes;
1] Saxon [for xml to html conversion]
2] XML files
3] XSLT files
4] Supporting files like css, common images etc.

This will be placed only once to end user machine.
So Client-Side methodology is involved here.

User can placed this as many machines they want with some basic limitations.

Here question is why i needed batch file creation in HTML [Javascript]?

Basically all will be done using batch file in Saxon. [File names are written in batch file and SAXON parser will take care of conversion.]

I want to create a GUI [I think HTML is the best and widely used] for user where he/ she will just place the file name and folder path in 2 different input box that value will be placed in batch file and when I click on process button on HTML page that batch file will run automatically [After completion of batch file processing automatically message will display that processing is over. {If possible only otherwise no message will dispaly}]

That is whole idea.

Is this possible??

Any further information required from me to solve this, i am always ready to share.

Cheers,
Mahesh
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 857
Reputation: Airshow is on a distinguished road 
Solved Threads: 122
Airshow's Avatar
Airshow Airshow is offline Offline
Practically a Posting Shark

Re: how to get values through javascript and pasted in batch file

 
0
  #5
Apr 28th, 2009
Mahesh,

Aha, I see.

You are into areas I have not been. My immediate thought is that trying to use the browser interface is a non-starter because browsers basically exist for client-server work and have inbuilt security constraints which limit their ability to interact with the client computer, though a good applet developer may well be able to tell you different.

I reckon that VB/VBA would be more appropriate for your front end than HTML/browser. Another approach would be simply to use the operating system's command line to run Saxon.

Maybe there's a Saxon support forum where you can search for a solution.

Hope this helps.

Airshow
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC