Answers are great but debug hints are also well appreciated.

This is killing me!!!!!

I have a stored procedure which I have whittled down to a few lines which does not completely execute when called from an ASP script. The proc WILL execute successfully when called from the SQL Query Analyzer. I developed this proc on one machine where it worked fine and then moved it to the production server where I can not get it to successfully complete the cmdshell request. I believe it may have something to do with security as the production server has been tightened and the development machine is just configured with all default levels. I have adjusted the User Rights as outlined in MSKB art#Q248391. I should note that the proc does not return an error it just does not execute the statement with the cmdshell request. In tracing and comparing the security event log from both machines I have found a discrepancy. On machine A (the working machine) the log shows:

(1)
Successful Logon:
User Name: SQLAgentCmdExec
Domain: DOMIND
Logon ID: (0x0,0x17D91)
Logon Type: 4
Logon Process: Advapi
Authentication Package: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Workstation Name: IGLOO2
(2)
Special privileges assigned to new logon:
User Name: SQLAgentCmdExec
Domain: DOMIND
Logon ID: (0x0,0x17D91)
Assigned: SeChangeNotifyPrivilege
(3)
A new process has been created:
New Process ID: 2153506272
Image File Name: CMD.EXE
Creator Process ID: 2156084160
User Name: info
Domain: DOMIND
Logon ID: (0x0,0x3941)
(4)
A new process has been created:
New Process ID: 2153663232
Image File Name: REGINI.EXE
Creator Process ID: 2153506272
User Name: SQLAgentCmdExec
Domain: DOMIND
Logon ID: (0x0,0x17D91)
(5)
A process has exited:
Process ID: 2153663232
User Name: SQLAgentCmdExec
Domain: DOMIND
Logon ID: (0x0,0x17D91)
(6)
A process has exited:
Process ID: 2153506272
User Name: SQLAgentCmdExec
Domain: DOMIND
Logon ID: (0x0,0x17D91)
(7)
User Logoff:
User Name: SQLAgentCmdExec
Domain: DOMIND
Logon ID: (0x0,0x17D91)
Logon Type: 4


On machine B the log is exactly the same except entry #4 is missing. Which is the indicator of the call to the exe in my shell request. Following the stored proc.

Create Procedure sp_PTtestproc

(
@returnmessage varchar(200) Output /*This will return the second line of the regini script file.*/

)
As


BEGIN
Execute master..xp_cmdshell 'c:winnt ools
egini.exe c:inetpubwwwrootwnwh emp
gt.txt'
Set @returnMessage = 'Process complete. Job will be sent.'
END


/* set nocount on */
return

Note: Before this proc was trimmed to the minimum it did successfully execute all line except for the cmdshell line. In fact one of the things that I tried was to remove CMD.exe from the system32 directory which did raise an error # 2 from CreateProcessAsUser.

Thanks for any light you may be able to shed.