473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

create Shell Object hangs

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?
Jul 19 '05 #1
3 6538
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

Nico wrote:
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?


Jul 19 '05 #2
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

Nico de Haen wrote:
Thank you Bob for your answer.

I understand the problem with the user interface, I just tried
notepad, since I found it in an example script. What I want to do at
least, is to call a Java class from ASP. Since
getObject("java:myClass") doesn't work, I want to try it with a shell
command. But I can't even get the WSHshell to work. The commands I
tried, were just for testing. I'm not shure, but for example the
mkdir-command should work, if I give writing permits in the directory.

I'm more experienced with JSP and PHP and it would be nice to use Java
with ASP, since then I have much more possibilities. (like using
XSLT-FO for creating PDF-files etc.)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #3
Hi,
How to call exe file from client machine using asp.net code...
I had some code but this code is Executed in server itself and that too cant view...

Dim WshShell
WshShell = CreateObject("WScript.Shell")
WshShell.Run("C:\temp\exeupload.exe")
WshShell = Nothing

Can u please provide a code for calling a client exe through asp.net page..

Thanks in advance..
If had some suggestion please send it to ramasamy.p@gmail.com
Rams
Sep 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Oliver Gräser | last post by:
Hej, I want to run batchfiles via the Shell, but accessible in the Browser via IIS. Actually, I'd like the server to start a command line ntbackup if a users selects to do so on an ASP in his...
1
by: Fei Yuan | last post by:
Please forgive me re-posting this question since I wasn't clear in my original post. --------> Starting an external process needs to pass it a ProcessStartInfo() object. ProcessStartInfo has a...
2
by: Mike John | last post by:
I am trying to use the shell object to send keys to the explorer browser to run the send page funcion. I am receiving the above error only when I put my html file in the web server...
7
by: martins | last post by:
Hi, My application uses SHELL command to run external programs, like this : Shell("program.exe", AppWinStyle.MinimizedNoFocus, True) or Shell("program.exe", AppWinStyle.Hide, True)
4
by: emin.shopper | last post by:
Emacs seems to freeze when doing certain shell commands on Microsoft Windows. The following is a simple example with Xemacs: ---------------------------------------------------------- ...
4
by: gwise | last post by:
We're running DB2 v8.2 (fix pak 11) on Red Hat Linux Enterprise 3 (kernel 2.4.21-32) on Itanium (IA64). For a few months now, we've had a recurring problem where a shell script that we run nightly...
2
by: Gerard Flanagan | last post by:
Hello, I have a third party shell script which updates multiple environment values, and I want to investigate (and ultimately capture to python) the environment state after the script has run....
2
by: Ant | last post by:
Hi all, There's a sweet combination of tools that you can assemble using Vim, a Python shell (or any shell for that matter) and GNU screen, where you essentially send selected text from Vim to...
7
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.