Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2154
  • Last Modified:

IIS6 and ASPExec

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
juststeve
Asked:
juststeve
  • 7
  • 6
  • 5
  • +3
2 Solutions
 
af500Commented:
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
 
fz2hqsCommented:
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
 
af500Commented:
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
Technology Partners: 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!

 
juststeveAuthor Commented:
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
 
fz2hqsCommented:
Why not just schedule a job then rather than having this called from a web page ?
0
 
juststeveAuthor Commented:
Typically that'd be ok...right now I'm actively troubleshooting/debugging and want immediate feedback after I made a file change.
0
 
fz2hqsCommented:
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
 
af500Commented:
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
 
juststeveAuthor Commented:
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
 
juststeveAuthor Commented:
Yep...I'm using full path to all files. I've edited the setting on cmd.exe to allow IUSR access.
0
 
Nelson_PiresCommented:
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
 
fz2hqsCommented:
Quote "The batch runs LogPrep.exe"

No dll's invovled
0
 
Nelson_PiresCommented:
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
 
af500Commented:
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
 
af500Commented:
What is the error??!!
0
 
juststeveAuthor Commented:
Good thinking but alas, err.description is blank:

not working
The Error Is:
0--

i tried using err.source with same no result.
0
 
fz2hqsCommented:
What does "response.write ret" give you ?
0
 
juststeveAuthor Commented:
1
0
 
fz2hqsCommented:
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
 
juststeveAuthor Commented:
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
 
CYChngCommented:
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
 
tleekCommented:
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 7
  • 6
  • 5
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now