Faulting Application kernel32.dll, version 5.2.3790.4062

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
cplusplus
Newbie
Posts: 3
Joined: Tue May 05, 2009 8:36 pm

Faulting Application kernel32.dll, version 5.2.3790.4062

Post by cplusplus » Tue May 05, 2009 8:40 pm

I am using the following script: DeleteFile on the windows server 2003.

**************

Code: Select all

IfFileExists>%archivepath%%filename%
DeleteFile>%archivepath%%filename%
DateStamp>%logfilename%,%archivepath%%filename% already exists a copy of it was placed in the archive folder
Endif
CopyFile>%flline%,%archivepath%%filename%
IfFileExists>%archivepath%%filename%
DateStamp>%logfilename%,Created file %archivepath%%filename%
Endif

Whenever it hits the deletefile, is generating the event id 1000
Event Type: Error
Event Source: Application Error
Event Category: (100)
Event ID: 1000
Date: 4/20/2009
Time: 10:29:13 PM
User: N/A
Computer: D6DOC01
Description:
Faulting application Paco Group Processing.exe, version 0.0.0.0, faulting module kernel32.dll, version 5.2.3790.4062, fault address 0x0000bee7.

For more information,
see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
***********************

This is happening at times randomly.

Really appreceate your help.
Thanks.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue May 05, 2009 8:59 pm

Is it possible that Paco Group processing.exe (or some other program) has the file open that you are trying to delete? Perhaps you need to insert a delay to make sure the file is unlocked before you try to delete it?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

cplusplus
Newbie
Posts: 3
Joined: Tue May 05, 2009 8:36 pm

Post by cplusplus » Tue May 05, 2009 9:24 pm

Hello Bob,

This is my first time trying to debug this script, is it possible can you please if don't mind provide me a sample script.

How to use the delay.

I use the following program img2pdf.exe to process image files to searchable pdf's:

Code: Select all

Function IsProcessRunning(ProcessName)
	Set oWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
	Set colProcessList = oWMIService.ExecQuery ("Select Name from Win32_Process where Name='" & ProcessName & "'")
	IsProcessRunning = colProcessList.count
End Function
VBEND
Label>seeifstopped
VBEval>IsProcessRunning("Img2PDF.exe"),res
//MessageModal>res



Bob Hansen wrote:Is it possible that Paco Group processing.exe (or some other program) has the file open that you are trying to delete? Perhaps you need to insert a delay to make sure the file is unlocked before you try to delete it?

Code: Select all




User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed May 06, 2009 12:25 am

Don't know how the last code works with the original code. And I usually use Macro Scheduler vs. VBScript, so here is a generic example just using MacroScheduler:

Code: Select all

// RP_WAIT will make the rest of the script wait until the exe file is done.
Let>RP_WAIT=1
Run Program>Img2PDF.exe
IfFileExits>%archivepath%%filename%,Step1,Step2

   Label>Step1
   DeleteFile>%archivepath%%filename%
   // The next line is a simple way to insert a delay
   Wait>20
   DateStamp>%logfilename%,%archivepath%%filename% already exists a copy of it was placed in the archive folder
   GotoEnd

   Label>Step2
   CopyFile>%flline%,%archivepath%%filename%
   IfFileExists>%archivepath%%filename%,Stamp,Seek

   Label>Seek
   // This is a simple way to loop until the file exists
   Wait>10
   Goto>Step2

   Label>Stamp
   DateStamp>%logfilename%,Created file %archivepath%%filename%

Label>End
There are many ways to wait or delay.
You can make the wait period a variable so you can insert delays and modify them in many places by just changing the variable, like this:

Code: Select all

Let>Delay=10
Wait>%Delay%
You can use different Conditional or IF commands, not limited to: WaitWindowOpen, WaitWindowClosed, IfFileExists, WaitWindowChanged, Repeat-Until, IfFileChanged, IfDirExists, etc.

So, maybe you need to consider using one or more of these tools before you run the DeleteFile command. If you do create a loop, you should consider putting in a counter or another time delay to stop an infinite loop. You need to have a way to exit from a routine that did not work properly after a reasonable time.
================================
None of this addresses your error message, it just spun off from the possibility that perhaps the file to be deleted was locked somehow. Did not mean to get you off track.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

How to use the IsProcessRunning wait

Post by gdyvig » Wed May 06, 2009 2:26 am

The RP_WAIT method Bob proposed should be the easiest most straightforward way of waiting the minimum amount of time.

FYI, here is how to use the IsProcessRunning method:

Code: Select all

VBSTART
Function IsProcessRunning(ProcessName)
	Set oWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
	Set colProcessList = oWMIService.ExecQuery ("Select Name from Win32_Process where Name='" & ProcessName & "'")
	IsProcessRunning = colProcessList.count
End Function
VBEND
Let>counter=0
Let>maxcount=10
Repeat>counter
  wait>1
  VBEval>IsProcessRunning("Img2PDF.exe"),res
  if>res=0
    Let>counter=maxcount
  else
    Let>counter=counter+1
  endif
Until>counter=maxcount
if>res>0
  MessageModal>Process did not stop in %maxcount% seconds
endif

Note: The above code is untested.


Gale

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts