Solved

IIS6 and ASPExec

Posted on 2003-12-01
23
2,137 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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
 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 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