Does SET /U broadcast WM_SETTINGCHANGE?

May 20, 2008
12,167
133
Syracuse, NY, USA
I thought I might use a user environment variable to tell a BTM (started by Explorer) that it was already running. That failed. A second instance of the BTM (also started by Explorer) didn't see the user environment variable set by the first instance. Does TCC broadcast WM_SETTINGCHANGE when it does SET /U? [Or maybe Explorer doesn't honor it.]. I used a sentinel file in %TEMP instead.
 
From the Help File;
SET command - Display or modify environment variables
If the Update Environment on System Change configuration option is set, TCC will monitor the WM_SETTINGCHANGE message and update the environment from the User, Volatile, and System registry entries. The update is done whenever TCC displays the prompt (to prevent the environment from changing in the middle of a command).

Joe
 
From a TCC Console, I did;
Code:
E:\Utils>set /u isrunning=Y

E:\Utils>echo %isrunning
Y

I closed the TCC Console.

From Windows Explorer, I launch the following .BTM;
Code:
@setlocal
@echo off
echo %isrunning
pause
endlocal
...which opens a new TCC and displays;
Code:
Y
Press any key when ready...

I open a new TCC, and;
Code:
set /u isrunning=N

From Windows Explorer, I launch the .BTM again, and it returns;
Code:
N
Press any key when ready...

So it looks like TCC does tell Explorer about it.

Joe
 

Similar threads