Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Does SET /U broadcast WM_SETTINGCHANGE?

May
13,450
193
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
 
I'm aware of that (and it's set). I'm talking about the other way around. TCC changes the user environment ... does TCC tell Explorer about it? My second attempt at this is working. Maybe there was an error in my first attempt.
 
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
 
Yeah. I see the same behavior. I must have screwed up the first try.
 
Back
Top
[FOX] Ultimate Translator
Translate