create Shell Object hangs

N

Nico

I try to execute a shell command from ASP with:

response.write("start")
Set wshShell = CreateObject("WScript.Shell")
wshShell.Run "notepad"
Set wshShell = Nothing
response.write("finished")

but it doesn't work, there is no error message, the page just displays
nothing. I tried various commands like "mkdir test" or calling a batch
file, always with the same result. When I just create the object, but
don't run a command the page is displayed without error messages.

Any ideas?
 
B

Bob Barrows

You can't shell to a program that uses a user interface from server-side
code. Think about it: who is going to be sitting at the server's monitor to
work with and close these notepad windows ...?

If you want something to be called on the user's machine, then you need to
be thinking about client-side code. Just be aware that there are security
issues involved with client-side code as well. Would you want to navigate to
a web page that used client-side code to launch a potentially dangerous
program (format c:) on your machine?

You will need to investigate hta (html applications) and move followups to
this discussion to a client-side script newsgroup such as
m.p.scripting.vbscript or jscript.

HTH,
Bob Barrows
 
B

Bob Barrows

I read somewhere that it is possible to use Java objects in asp, but I never
really looked into it. I suggest you do a search at msdn.microsoft.com or
via google to get further information.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top