Web Hosting Talk







View Full Version : Very Technical Q


fatbargains
09-10-2002, 12:17 PM
ASP Question: Passing a command to DOS on a webserver & execute that command.


I'd like to have a user enter this parameter (different for each user) to a webform, when the user clicks on Submit the parameter is passed onto DOS on the webserver (NT Server) and launch DOS. How would i do this? As much details as possible. Thanks.

lpguitars
09-10-2002, 03:15 PM
I think you should be able to do that easily with ADSI. I found this example which is WSH but should work with ASP.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q234001

Hope that helps.

fatbargains
09-10-2002, 03:32 PM
OK...this would launch DOS:

dim wsh
set wsh = createobject("WScript.Shell")
wsh.run("c:\winnt\notepad.exe")dim wsh
set wsh = createobject("WScript.Shell")
wsh.run("c:\winnt\notepad.exe") //change to DOS dir



Does anyone know how to pass a command line to DOS?

lpguitars
09-10-2002, 04:14 PM
I'm not sure if this will help, but I found this article in a MS newsgroup:

It talks about using the Command Variable to store and pass your variables to the command line.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=04161C1D83C4D311ABD10050DA6CB709A793%40TECH002

Hope it helps.

fatbargains
09-10-2002, 04:32 PM
well.. i try this in my asp page:


dim wsh
set wsh = createobject("WScript.Shell")
wsh.run("c:\winnt\notepad.exe")dim wsh


and it doesnt run Notepad.. does anyone know the code used to launch an app? what's wrong w/ the above?

lpguitars
09-10-2002, 04:47 PM
are you sure it is not launching notepad? Like you have checked in your task manager to see if it is running? Cuzz a process from within IIS won't make it popup on the screen or anything but still may be launching the app.

fatbargains
09-10-2002, 04:57 PM
Yeah.. it shows on the task manager.. but how do i see it outside? what do i have to do?

lpguitars
09-10-2002, 08:49 PM
I think - and am sort of just guessing, but that the IIS process has to be happening under the same user you are logged into the machine as - but again, that's sort of a guess.

PJamie
09-11-2002, 04:45 AM
Originally posted by fatbargains
ASP Question: Passing a command to DOS on a webserver & execute that command.


I'd like to have a user enter this parameter (different for each user) to a webform, when the user clicks on Submit the parameter is passed onto DOS on the webserver (NT Server) and launch DOS. How would i do this? As much details as possible. Thanks.

and

Yeah.. it shows on the task manager.. but how do i see it outside? what do i have to do?

You can't.

The command window will only be available on the server. There isn't any way to make this happen so that the command window on the server is viewable on your browser.