The script is already using the database to flag if it is currently running. The problem is if the script dies about once a month and leaves the flag open. I have no way of determining inside the script if the script is still truly active the next time it runs. I was hoping to get the pid so I could test to see if it has become stale. Unfortionatly, it has to stay a VBScript. Ill have to ask the server admin if I can register a dll.
Main Topics
Browse All Topics





by: DominicCroninPosted on 2004-07-17 at 10:02:15ID: 11575072
I don't have an answer for you, but I can tell you that in the past I have written a VB class just to be able to write "Private Declare Function GetCurrentProcessId Lib "kernel32.dll" () As Long"
AFAIK, you can't do this in a vbscript, although you could instantiate your VB class from a script, so that's a partial solution, but perhaps you don't want to deploy COM classes on your target machine?
Perhaps the process ID isn't the way to go. Have you thought about perhaps writing a registry key and then testing for it? This is an interesting problem and a solution will be generically useful.