Solved

IIS6 and ASPExec

Posted on 2003-12-01
23
2,117 Views
Last Modified: 2007-12-19
I'm trying to fire a batch file using ASPExec.dll. The batch works from command line and i've double-checked the perms for the web user both to write to my given subdirectory and to call cmd.exe. Before I changed the perms on cmd.exe i was getting a 'Could not create process' error...after opening up cmd.exe I don't get the error but the batch doesn't run either.

Is there a way to track the execution of a batch file in this situation?

thankx
--steve...
0
Comment
Question by:juststeve
  • 7
  • 6
  • 5
  • +3
23 Comments
 
LVL 4

Expert Comment

by:af500
ID: 9852977
You could set a file level audit for your batch to see when it was last exe'd.
Also, make sure you have IIS setup correctly. Out of the box, or default install IIS 6.0 is pretty stipped down.
0
 
LVL 9

Expert Comment

by:fz2hqs
ID: 9857430
juststeve - what is it that your batch file is trying to achieve exactly, most of the time it is easier to re-engineer a process than trying to layer a wrapper like this
0
 
LVL 4

Expert Comment

by:af500
ID: 9857635
You could also try something like this:

<%
set oWS=server.createobject("WScript.shell")
ret=oWS.Run("X:\my.bat", 2, true)

if(ret=0) then
response.write("it is working<br>")
else
response.write("not working<br>")
end if
%>
0
 

Author Comment

by:juststeve
ID: 9857682
I guess i need step by steps in the 'set file level audit' and what to watch for....I've tried a couple things but so far that hasn't made a lot of sense.

The batch runs LogPrep.exe (massages the contents of the server log file into a db-importable format) and fires a stored procedure that imports it to my db.

Currently I maintain a Terminal Services connection to run it from a command window everything i want to update the db-logs (frequently). I'd like to eliminate the need for TS by firing the batch from a hit to a web page.
0
 
LVL 9

Accepted Solution

by:
fz2hqs earned 275 total points
ID: 9857708
Why not just schedule a job then rather than having this called from a web page ?
0
 

Author Comment

by:juststeve
ID: 9857727
Typically that'd be ok...right now I'm actively troubleshooting/debugging and want immediate feedback after I made a file change.
0
 
LVL 9

Expert Comment

by:fz2hqs
ID: 9857748
WHat might be a good idea then is to se the WScript calls that af500 suggests, and have that batch file right out some sort of report to a text file ( no need with fancy html of xml) and that should report back to you enough info
0
 
LVL 4

Expert Comment

by:af500
ID: 9857953
One thing to look for is that your batch file uses explicits. ... so even if the .bat is in the same folder as your .exe or whatever your executing use the full path to it. Also, make sure your user has executable privs.
0
 

Author Comment

by:juststeve
ID: 9858013
af500's code returns 'not working'. i tested this with both IUSR & IWAM accounts inside the administrator's group. I also tested against a batch file that just does a 'dir' to see if the problem related to writing a file. no joy.
0
 

Author Comment

by:juststeve
ID: 9858049
Yep...I'm using full path to all files. I've edited the setting on cmd.exe to allow IUSR access.
0
 

Expert Comment

by:Nelson_Pires
ID: 9865742
Have you registered the DLL? If not do it from the cmd with regsvr32.

Alternatively, and to make it easier in future to reg and unreg DLL's, go to your registry editor, navigate to (HKEY_CLASSES_ROOT\dllfile) and add Key: RegSvr32, inside it another Key: Command, and inside Command change the Default value to: "regsvr32.exe %1", make sure you enclose it with "", now you can reg/unreg from the Windows Explorer, the options for it will be avalable on right-click over DLL's.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Expert Comment

by:fz2hqs
ID: 9865748
Quote "The batch runs LogPrep.exe"

No dll's invovled
0
 

Expert Comment

by:Nelson_Pires
ID: 9865792
Just some corrections to my reg/unreg approach:

Go to your registry editor, navigate to (HKEY_CLASSES_ROOT\dllfile) and add Key: RegSvr32, inside it another Key: Command, and inside Command change the Default value to: regsvr32 "%1"

To UnReg do the same but call it UnRegSvr32 > Command > Default with value of: regsvr32 -u "%1", now you can reg/unreg from the Windows Explorer, the options for it will be avalable on right-click on DLL's.

Hope this helps.
0
 
LVL 4

Assisted Solution

by:af500
af500 earned 225 total points
ID: 9866735
You could also try something like this:

<%
set oWS=server.createobject("WScript.shell")
ret=oWS.Run ("X:\my.bat", 2, true)

if(ret=0) then
response.write ("it is working<br>")
else
response.write ("not working<br>")
response.write ("The Error Is:<br>")
response.write (err.number & "--" & err.description)
end if
%>
0
 
LVL 4

Expert Comment

by:af500
ID: 9866738
What is the error??!!
0
 

Author Comment

by:juststeve
ID: 9868792
Good thinking but alas, err.description is blank:

not working
The Error Is:
0--

i tried using err.source with same no result.
0
 
LVL 9

Expert Comment

by:fz2hqs
ID: 9873082
What does "response.write ret" give you ?
0
 

Author Comment

by:juststeve
ID: 9873411
1
0
 
LVL 9

Expert Comment

by:fz2hqs
ID: 9873479
Provided you have the permissions correct and that you have scripts and execute permissions set in IIS (I am not 100% sure that execute is truley needed) then it may point to the WScript component itself. All to often we tend to assume it is our code and not MS - see if you can find an update http://www.microsoft.com/scripting
0
 

Author Comment

by:juststeve
ID: 9896665
No real resolution to my problem here but I have to move on. Extreme thankx to af500 for the help as well...i meant to split points out to you but clicked wrong. I'll post a change request to community support.
0
 

Expert Comment

by:CYChng
ID: 9989727
One possible solution is changing your IIS Application Pool setting. You can try to set the identity to Local System which is default identity for previous version of IIS.
0
 

Expert Comment

by:tleek
ID: 10146531
Hi Steve,

I'm not sure whether you get email notifiers on older stuff or not, so I  thought I'd post here as well.  I think the main problem was that IIS Admin needed to interact with the desktop as well, although I may be wrong, as I did do quite a lot of things quite late at night..

I've had exactly the same problems with ASPEXEC on a new install of WinXP Pro. After burning the midnight oil, and tearing out most of my hair, I managed to get it working..

Thought I'd post a note with the things I did to fix it, in case any of these are useful to anyone.

checked 'Allow service to interact with desktop' for IIS Admin as well as WWW svcs
allowed IUSR_****** read access to cmd.exe and read/execute to target directory
turned _off_ script blocking in Norton AV 2003...

didn't need scripts and executables turned on, only scripts.

I need to set it up on a 2003 server tomorrow myself, so will see..

Tiff
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now