Run .bat file from html...?

G

Geir

Hi,

Say I have a windows file share at \\myserver\runthis and in this folder
I have a .bat file which I need my users to run. The bat file does
various housekeeping, copies files and installs silently a small
application etc.

Is it possible to somehow enter a link to the complete path
\\myserver\runthis\myfile.bat at an intranet web page and have the file
downloaded and run at a client?

It runs nicely at the client computers when pasted in at a command
console, but it would be more elegant if the weblink opened the console
window automatically.

The clients in question run windows xp.

Thanks for comments on this

regards geir
 
A

Andy Dingley

Say I have a windows file share at \\myserver\runthis and in this folder
I have a .bat file which I need my users to run.  

Where does this bat file run? On the server, or on the user's desktop?

If it's the server, then you can do this. Find an old reference to CGI
scripting, but be aware that you need to know what you're doing or
else there are security hazards.

If it's on the user's desktop then you can't do this. For good reason
too (imagine the risk if used for evil purposes). At most you can
offer the script as a download and then have the users run it
separately.

The bat file does
various housekeeping, copies files and installs silently a small
application etc.

Silent installs from the web are a bad idea, as they aren't obvious
and so create distrust.
 
J

Jan C. Faerber

Where does this bat file run? On the server, or on the user's desktop?

You snipped the text out with the concerning information:

<quote>
Is it possible to somehow enter a link to the complete path
\\myserver\runthis\myfile.bat
_at_an_intranet_web_page_and_have_the_file_downloaded_and_run_at_a_client_?
</quote>

So it's on the user's machine. [2]

[1] > If it's the server, [...][2] > If it's on the user's desktop then you can't do this. For good
reason
too (imagine the risk if used for evil purposes). At most you can
offer the script as a download and then have the users run it
separately.

www.turkojan.com - lol
 
J

Jan C. Faerber

Or try "CIA 1.3" - *ggg*

http://en.wikipedia.org/wiki/XMLHttpRequest
I just came accross that topic.
Obviously it should be possible somehow.

http://prajax.sourceforge.net/
That thing might do something you would like to achieve but seems not
to handle a .bat file directly.
(the example source on that page:
http://prajax.sourceforge.net/examples/example_helloworld_prototype.php.txt
)

All standards and script handlings of browsers respect
restrictions for security purposes.
And even if you find a solution I am curious about
the 'silent' installation of the 'server's' .bat file.
I do not know the standard behaviour of windowsXP
but within Vista they started a security feature
which will promt always for administration priviliges
before software claim access to install itself.
(It is possible to disable this user interaction.)

http://skypher.com/index.php/2008/05/04/chimera-code/
http://skypher.com/wiki/index.php?title=Chimera_code
These links seem to be very interesting!
If the text is up2date then it would be interesting
if you could change your .bat file into a .cmd file.
'Cause these two things are similar but not _exactly_ the same.
In case you can also run the .cmd file you should be able to
generate a javascript file that should do the same thing
like the .cmd file. And then you could use the javascript in your
page.

Maybe you give further details of your problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top