Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IIS6 and ASPExec

Posted on 2003-12-01
23
Medium Priority
?
2,147 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
[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
  • 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

704 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