WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

AppExist Not Working on Some Platforms

Keywords:     appexist	 NT

Question:

AppExist isn't working for me on NT4. Can you explain why?

Answer:

  1. WinBatch accesses the HKEY_DYN_DATA section of the registry to get the information it uses for AppExist.

    If it cannot access the registry key it will fail.

    Also if the key is locked by some other application it can fail.

  2. Appexist has been know to fail on some NT systems when you run certain performance monitoring tools.

    The problem is that the HKEY_DYN_DATA section of the registry is quite tricky to access and most simpler performance monitors do not access it quite properly and lock other users out. If they lock us out, we can't see it, and AppExist fails.


More on AppExist on NT

Question:

He had a script that ran perfectly on 95, but now upgraded the machine to NT, and the script is taking 74 seconds on an AppExist line.

He's using WB2000b.

The AppExist is testing the existence of an app on a mapped drive to a server. This same command returned immediately in 95. Why would it be taking so long on NT4?

The app does NOT exist, so the next line in his script is to Run the app.

Any ideas as to why NT would behave differently than 95?

Answer:

AppExist is handled completely different in Windows 95/98 and NT/2000. Its one of the few functions that have to handled differently depending on the operating system. It not exactly clear whey it takes so long, but basically we ask windows for some information, and it seems to want to wander around the system looking for it. It usually does not take that long, but obviously something strange is going on.

There may be other ways to tell is the App exists or not. WinExist is probably one of the first contenders. I'm not sure if the new (NT Only) process extender might also be able to determine what is going on.

Here is a sample NT only script that uses our new "Process Extender"

It may be able to do the AppExist faster. Not sure, since AppExist works fast on all out machines here. Its worth a try.

AddExtender("wwprc44I.dll")
filename=StrUpper("WinBatch Studio.exe")
count=tCountProc()
proclist=tlistproc()
For x = 1 to count
  item=ItemExtract(x,proclist,@Tab)
  procname=ItemExtract(1,item,"|")
  if StrUpper(procname)==filename
   ; parse off process id
   procid=ItemExtract(2,item,"|")
   message("%Procname% exists","Process Id is %procid%")
  endif
Next

Article ID:   W13038
Filename:   AppExist Not Working.txt
File Created: 2013:04:01:09:16:02
Last Updated: 2013:04:01:09:16:02