1. It doesn't make much sense to use both /s and /u
2. No surprise it's still in TCC's environment; you didn't unset it there (that's what /e is for)
3. Do you close/reopen the system variables dialog? Here (Win7), it disappears.
Brief tutorial: Every process inherits the environment of its parent process. From then on that environment belongs solely to that process. In the case of TCC you manipulate it with [un]set and whatever it is at the moment is passed to (TCC) child processes. When you use /s or /u you're manipulating environments stored in the registry (/u ... the HKEY_CURRENT_USER one ... used at login, /s ... the HKEY_LOCAL_MACHINE one ... used at startup) and broadcasting a message saying that you did that. As I said before, Explorer updates its own environment as a result of receiving that message (few other apps do). If you want to **also** affect the current TCC environment when you use /s or /u, then also use /e.
Vince, I used both /s and /u in case I was " missing something."
"All" I am trying to do is: set a var to represent the given browser, so that any btm file can call LFMBROWSER and get the browser I want at that "moment." That way any number of shortcuts that rely on a browser will use the one I want.
So then I thought [silly me] that I should use a batch file. Within that bat [btm] file, I could set / verify the browser that would be called -- not always the default browser. Then, because I had set several shortcuts to call the browser via %LFMBROWSER%, I came to the problem of setting and unsetting a TCC / TCMD variable.
This of course is assuming that, by associating btm files to TCC [for example], I would be in a TCC environment when I executed a shortcut.
I THOUGHT I understood what you were telling me, but obviously I am having a senior moment.
TCC /TCMD has nothing to do with your shortcuts that have the %LFMBROWSER% target. That's Explorer's business. If you want to change Explorer's idea of what %LFMBROWSER% means, TCC is one way to do that. Just "SET /U LFMBROWSER=some-browser" ... want to change the browser ... "SET /U LFMBROWSER=some_other_browser". That changes some info in a registry key and announces (to any app that's interested) that such a change was made. Explorer gets the announcement and changes its own (i.e., Explorer's) environment so it (Explorer) has a new notion of what %LFMBROWSER% means and does the right thing when you 2click a shortcut.
Yes. And it would stick forever. That's the point of the /u and /s environments; they're saved and reinstated upon login or restart (respectively). Change it and the new one will be remembered until you change it again. All users get the variables assigned with /S; **you** get (at login) the ones assigned with /U. I wouldn't even bother with the /S environment (you wouldn't even see your shortcuts if you logged in as another user). If you want to see where these are saved, use REGEDIT.EXE and navigate to HKEY_CURRENT_USER\Environment and to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. When you login, the two environments are merged and become the environment of the shell (Explorer). All processes are free to mess with their own environment (as with SET var=value); these changes are propagated to child processes but no up to parent processes.