How to set an environment variable only for Thunderbird?

User Help for Mozilla Thunderbird
Post Reply
pstover
Posts: 299
Joined: July 29th, 2005, 3:25 am

How to set an environment variable only for Thunderbird?

Post by pstover »

Assume I want to set an environment variable just for Thunderbird.

It should not be visible outside for other programs.

How can I achieve this?

Peter
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: How to set an environment variable only for Thunderbird?

Post by morat »

Try something like:

* Command Prompt

Code: Select all

set Example=Alpha Beta Gamma
thunderbird.exe
* Thunderbird

Code: Select all

// scriptable access to current process environment
var environment = Components.classes["@mozilla.org/process/environment;1"].
  getService(Components.interfaces.nsIEnvironment);
alert(environment.get("Example")); // Alpha Beta Gamma
Set Command
http://ss64.com/nt/set.html

nsIEnvironment Interface
http://developer.mozilla.org/en-US/docs ... nvironment

Edit:

If I then open the firefox.exe process with windows explorer or in another command prompt window, then the "Example" environment variable would be an empty string.
Last edited by morat on January 11th, 2018, 3:06 pm, edited 1 time in total.
pstover
Posts: 299
Joined: July 29th, 2005, 3:25 am

Re: How to set an environment variable only for Thunderbird?

Post by pstover »

This is exactly what is NOT suitable

As I said in my initial posting: The environment variable should NOT be visible by other prigrams.
If I enter

set Example=Alpha Beta Gamma

It IS visibale by other programs since it is global
So your suggestion does NOT fit.

So I need a file in "profile" folder where to enter the environment variables.

Peter
Post Reply