English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can anybody tell me how can i run a DOS command from HTML?
For example if i want to run ping command then i will first go to start---> Run ---> Ping
I want to run it with the help of HTML code.....
Please write the HTML code also.
Please help me!!

2006-10-25 07:27:55 · 5 answers · asked by So2 1 in Computers & Internet Programming & Design

5 answers

Well, HTML is processed on the client side and it does not have any way to run DOS command if you want it done strictly in HTML. This restriction is there mainly because it can post a security risk to the users. However, if you have some kind of server-side technology like ColdFusion, ASP, ASP .NET, PHP, JSP,...etc., you can use the server-side technology to run DOS command on the server side though.

I am a web developer by trade. Please feel free to contact me if you have more questions.

2006-10-25 07:32:19 · answer #1 · answered by knitting guy 6 · 3 0

This is achieved by using the Windows Script Host. First, create an instance of the object WScript.Shell. Then, use its Run method to execute the DOS command. For example, say your HTML page has a button that will run the DIR command when clicked. The onclick jscript function would look something like this:


-------------------------
function btnDIR_onclick()
{
var WshShell = new ActiveXObjec("WScript.Shell");
WshShell.Run("%comspec% /c DIR");
WshShell.Quit;
}
----------------------------


The %comspec% string in the argument for Run() specifies the path and file name of the command interpreter, Cmd.exe.

2006-10-25 07:31:19 · answer #2 · answered by Anonymous · 1 0

I dont know HTML too well, but I would suggest look for a site that allows you to ping. Then look at the source code for that page. Try to find it that way.

2006-10-25 07:30:35 · answer #3 · answered by chuck g 5 · 0 0

If you're utilising ftp console in Windows, you'll research its command line via urgent: support All instructions will likely be show and you'll have extra element on every command via urgent: support command Some such a lot used command is: cd (difference listing), placed (add a dossier from regional to far off), get (down load a dossier from far off to regional), mkdir (make listing), rmdir (cast off listing), delete (delete a dossier), rename (rename a dossier) Hope it is helping

2016-09-01 02:32:14 · answer #4 · answered by ? 4 · 0 0

i dont think you can as it would pose a security risk.

2006-10-25 07:30:54 · answer #5 · answered by Tiger 5 · 0 0

fedest.com, questions and answers