Forum > General
Initiating Windows Shell Commands
(1/1)
Jishaxe:
How would I execute a Windows Shell command programmicly?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---ShellExecute(Handle,'open','command.com',Whatevercommand,nil,SW_SHOW); Just brings up cmd, with no commands in it. Cmd then stays up.
Thanks in advance,
- Josh
eny:
Try running 'command /?' in a command box.
You'll see that '/C <actual command>' does the trick.
marcov:
--- Quote from: Joshuzzz on July 02, 2010, 01:28:19 am ---How would I execute a Windows Shell command programmicly?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---ShellExecute(Handle,'open','command.com',Whatevercommand,nil,SW_SHOW); Just brings up cmd, with no commands in it. Cmd then stays up.
--- End quote ---
(the windows shell is cmd.exe, command.com is the dos compatibility shell)
Navigation
[0] Message Index