viewpoint-particle

Author Topic: AppExist( ..., 1 ) meaning and syntax  (Read 514 times)

archimede

  • Full Member
  • ***
  • Posts: 115
AppExist( ..., 1 ) meaning and syntax
« on: October 23, 2023, 03:14:54 am »
Windows 7 x64.
I use
AppExist("Notepad.exe")
It no detects Notepad.exe working.
If I use
AppExist("Notepad.exe",1)
it detects the notepad.exe working: why?
What is the meaning of "Current-session-only"?
Thank you very much.

td

  • Tech Support
  • *****
  • Posts: 4444
    • WinBatch
Re: AppExist( ..., 1 ) meaning and syntax
« Reply #1 on: October 23, 2023, 08:37:46 am »
From MSFT docs: "A session consists of all of the processes and other system objects that represent a single user’s logon session.  These objects include all windows, desktops and windows stations.  A desktop is a session-specific paged pool area and loads in the kernel memory space.  This area is where session-private GUI objects are allocated from.  A windows station is basically a security boundary to contain desktops and processes.  So, a session may contain more than one Windows Station and each windows station can have multiple desktops."
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

archimede

  • Full Member
  • ***
  • Posts: 115
Re: AppExist( ..., 1 ) meaning and syntax
« Reply #2 on: October 23, 2023, 09:21:02 am »
Interesting.
And then, why if I specify
AppExist("Notepad.exe")
it no works, but if I specify
AppExist("Notepad.exe", 1)
it works?

td

  • Tech Support
  • *****
  • Posts: 4444
    • WinBatch
Re: AppExist( ..., 1 ) meaning and syntax
« Reply #3 on: October 23, 2023, 01:44:16 pm »
Your system likely has corrupt or disabled performance counters. Check the Tech Database to learn how to fix it.

https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Functions+!!~Performance~Monitoring~and~WinBatch~!!.txt

<edit> That article is a bit over the top so start a command prompt window and run the LODCTR /R command which will automagically rebuild your counters.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

archimede

  • Full Member
  • ***
  • Posts: 115
Re: AppExist( ..., 1 ) meaning and syntax
« Reply #4 on: October 24, 2023, 12:58:45 am »
Windows 7 x64.
I used Exctrlst.exe but it show ONLY Outlook performance counters is off: all others are ON.

I used
loadctr /R
and now the AppExist( ... ) function seem work well; Exctrlst.exe shows ONLY Outlook performance counters is off, like before.
Then:
- why Exctrlst.exe tell it is all ok (except Outlook), but using loadctr /R it seem solve the problem?
- I no understood a thing: loadctr /R is BETTER than Exctrlst.exe or not?
- Could be useful execute loadctr /R at every windows start?
Thank you very much

td

  • Tech Support
  • *****
  • Posts: 4444
    • WinBatch
Re: AppExist( ..., 1 ) meaning and syntax
« Reply #5 on: October 24, 2023, 07:04:34 am »
Exctrlst.exe is used to enable and disable performance counters on a per-application basis. Lodctr /R recreates counters from a system cache. Enabling/disabling is not the same thing as recreating.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade