|
-
run dos command from html page
what does the /c DIR represent in the code below
i know what the %comspec% is but not the rest
what i need to do is run a python file from an HTML page
for a demonstration for collage
Run a DOS Command From an HTML Page
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 ActiveXObject("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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks