# Input info from html to BAT



## Code One (Jan 5, 2004)

hello,
first off let me explain , no im not trying to create a virus, and secondly, this will be soley for offline use.

ok, my question is, is it possibly to ste up a BAT file that can receive data input from an html document, and then be submitted, and then have the bat file do as what was submitted.

example:

i would like to setup a BAT file to delete files on my system, but the trick is, id like to input which file from an html document, and then hit submit, and have that input, transfered to the BAT file so that the BAT file will then process the input from the HTML document, and delete the specified file or folder.

/example

now if this isnt possible can I atleast do the same from a text file?

again, i wish not to do anyone harm with this knowledge, it is soley for my own personal knowledge.

thank you

code one


----------



## mole (Aug 24, 1999)

What you seem to be asking for is a GUI (graphical user interface) wrapper that can take input and pass it to a *.bat. While what you want to do from HTML is not a terribly trivial thing to do, it could be done but is beyond the immediate scope of the forum. It would help if you had access to a webserver on an intranet or could set up a file type (*.xyzpdq for example) associated a particular executable with "confirm after download" not activated so you could initiate a create process straigh away by clicking a link in an HTML file. I have done that.

For a simpler approach: To get a GUI input for a batch (not using HTML as you asked), if you are using Win9x/ME make a shortcut to the batch file you want to run and enter a ? as a command line parameter, if you are using WinNT/2K/XP, find the file (usually in c:\winnt\system32) named "_default.pif" and copy it to another directory, for example c:\junk. Perform the same operation by adding a ? as the command line parameter to be passed to which ever batch you edit in to be run by the *.pif. When you double-click on teh *.pif which starts teh batch, before teh batch runs, a small GUI dialog box will open in which you can type in a parameter to be pased to your batch as %1 in the script. For more on this subject, see:

http://www.pressroom.com/~tglbatch/input95.html

The second half of the page roughly describes the same thing I have above. This is for Win9x/ME only, and the page seems to imply that it can't be done in NT/2K/XP, but it can, use a copy of the _default.pif file as described.


----------



## Code One (Jan 5, 2004)

hey,
thanks alot man, your the only person i have talked to about this that even remotly understood my question, thanks alot for the info.

makes since and is brilliant.

code one


----------



## mole (Aug 24, 1999)

Glad that helped out. I also point people to Rob VanderWoude's site: http://www.robvanderwoude.com/ for more info on batch's. Search his site using the words "user input". You'll also find references to KiXtart which is a logon language that has far more utility than running login scripts.

You could run KiXtart scripts, *.kix files from HTML by creating a file association with them and the kix32.exe executable in Explorer > tools > folder options > file types, then as I mentioned in the earlier post set "confirm open on download" so you don't get prompted and the file will execute straight off of the HTML page. You can then harvest teh regkeys from the workstations you set this up on so that you can transplant them to others.

This is very powerful and you must be careful how you use it. I suggest making an obscure file type association, not with the *.kix file, but the *.xyzpdq I also mentioned earlier. This is a fairly secure means of launching applications via an HTML file if you select your executable and file type such that arbitrary code won't also get run if a user browses through an otherwise harmless page.

I trust that you have no malicious intent. The method above is more or less outlined in Brian Livingston's Windows 95 secrets book (sort of hints at it, but never outright describes in detail), so it is not as if this hasn't been published elsewhere.


----------



## Code One (Jan 5, 2004)

no, no malicious intent at all, in fact i seen from listening to others who have been attacked and seen how distrut and helpless almost, they become, and it bothers me to see that, I could never make it my purpose to attack anyone, it is absolutly childish, to say the least.

My intent with this is to keep it offline, assume it will work that way.

thanks for all the help, and yeah ill check out the other resource as well,

code one


----------

