Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: Launching an application through the Internet


Message #1 by "Luis Maynar" <luis.maynar@n...> on Wed, 24 Jan 2001 17:01:58 -0000
Hi all,



I would like to know how to launch an application that is located in the

server from a web page.  I would like my user to be able to launch, say

Notepad.exe, on my server by making a hit to an asp file.



I know that it has to be implemented by creating a COM dll but I don't

know exactly how.



Thanks a lot



LUIS

Message #2 by Robert Chartier <rchartierh@a...> on Wed, 24 Jan 2001 12:18:29 -0500
serverobjects.com has ASPExec



or you could, in VB..do:



shell()



or CreateProcess API





Open VB...new ActiveX dll

rename the project, and class file  (the PROGID of the COM will be 

ProjectName.ClassName)

in the class file, create a function:



--->see

http://www.planet-source-code.com/xq/ASP/txtCodeId.1052/lngWId.1/qx/vb/scripts/ShowCode.htm

to see how to use the "CreateProcess" api...or simply:



public sub exec(byval program as string, byval parameters as string)

         dim returnval as variant

         returnval = shell(program + " " + parameters)

end function





save & compile the object into a .DLL file

open the MTS (winnt) or Component Services (Win2k) snap in in MMC

create a new package, allow it to persist as which ever user you wish..

add the DLL to the package (can click & drag into it)



then, in ASP try:



dim oExec

set oExec = server.createobject("ProjectName.ClassName")

oExec.exec("c:\winnt\notepad.exe","c:\autoexec.bat")

set oExec = nothing





thats the basics of it anyways.



some notes:

1.  This will open the program as specified...and it will either be set to 

interact or not to interact with the desktop.  if it is NOT interactive, 

then you can use the task manager (ctrl-shift-esc) and see the notepad.exe 

process.

2. the obvious security issues should be understood  (ie, program parameter 

being "FORMAT", and parameters being " c: /q"



etc.







At 12:01 PM 1/24/01, you wrote:

>Hi all,

>

>I would like to know how to launch an application that is located in the

>server from a web page.  I would like my user to be able to launch, say

>Notepad.exe, on my server by making a hit to an asp file.

>

>I know that it has to be implemented by creating a COM dll but I don't

>know exactly how.

>

>Thanks a lot

>

>LUIS

>



Robert Chartier

Author, AspFree.com

xxx-xxx-xxxx

rchartierh@a...

http://www.aspfree.com/devlinks

http://www.aspfree.com/authors/robert

http://www.aspalliance.com/nothingmn




  Return to Index