Solved

shell.run hangs

Posted on 2004-08-20
5
1,064 Views
Last Modified: 2010-08-05
Hi
I am trying to run regsvr32.exe from an ASP code using WScript Shell object with such code:

<%
Dim wshell, intReturn
set wshell = server.createobject("wscript.shell")
intReturn = wshell.run("%comspec% /c regsvr32 /u ""C:\Documents and Settings\Hojjat\Desktop\shell.wsc"" ", 0, True)
Response.Write( intReturn )
set wshell = nothing
%>

Looking to my task manager, I see that IWAM user on my computer openes cmd and regsvr32 programs, but it failes to unregister the component.
When I run this sample code to open Notepad:

<%
Dim wshell, intReturn
set wshell = server.createobject("wscript.shell")
intReturn = wshell.run("%comspec% /c notepad.exe", 0, True)
Response.Write( intReturn )
set wshell = nothing
%>

It not only does not open notepad, but also hangs running the code. I don't know how to finish the procedure or close notepad.exe myself.

Why does the code hang on running regsvr32, notepad.exe etc? Notice that IUSR user has the permission to read and execute regsvr32 and notepad.exe on my machine.

Huji
0
Comment
Question by:huji
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:wesbird
ID: 11850864
if would be a good idea to include the /s option to regsvr32 to prevent it from opening a mesage box on the desktop of the process - which is probably invisible unless you're logged on interactively as IUSR_...
0
 
LVL 7

Accepted Solution

by:
wesbird earned 500 total points
ID: 11850911
I meant to say "window station" of the process.  See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/window_stations.asp.

Your code is not hanging, merely being displayed on a window station that you cannot see because it is not interactive.
0
 
LVL 14

Author Comment

by:huji
ID: 11852069
Well, hang problem is solved by now, but the code is not acting indeed. It returns 5 to me, which I don't know what it means, but I know it is different from normal 0 or 1 values I have recieved from a Run command.
Do you know why it is not acting? And by the way, can I register components this way? For example upload a DLL to my root directory, then install it running regsvr32 through ASP?
Huji
0
 
LVL 14

Author Comment

by:huji
ID: 11865374
Please pay attention to this question:
http:Q_21101268.html
Huji
0
 
LVL 7

Expert Comment

by:wesbird
ID: 12519956
PS for any late readers on this thread.. 5 usually means access denied.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question