$GetEnv in Mp3Tag 2.48a

Just saw the new $getenv(x) function.
Translated form the German help file of the development build:
$getenv(x) returns the value of the environment variable x.

Never heard of environment variables before, so some questions:

Is there a list of the environment variables which can be used?
Can this list be expanded in Windows by the User?
Is there a variable for the clipboard (ctrl+c/ctrl+v) or can this be created?

So far, I found this list on wikipedia:


to see the current Environment Variables on your PC, just goto a command Prompt and issue the command SET, this will display all environment variables and their values for your computer / userid.

This article should help a bit with the other questions.


Hmm ... never used %appdata% so far?

The attached Mp3tag MTE export script displays some usual environment variables in a text file.

Export Skript Version 1.0
Test.getEnv.mte ( 1.54K ) : 28

Export Skript Version 1.1
Test.getEnv.mte (1.85 KB)

Test.getEnv.mte (1.85 KB)

Thank you for your answers.

Yes, i used %appdata%, but i didn't know that this is an environment variable. I just used it.

So, as far as I can see there seems to be no environment variable for the clipboard and it can't be created, right?

You can see additional non-Microsoft environment variables if you press [windows-key]-[break/pause], select tab-folder Extended and press the button "environment variables".
In this dialogue you can add, edit, delete user-defined environment variables.

In the old days these variables were set by the file autoexec.bat or win.ini.


I looked up this thread after reading your response to me in a different forum, to learn about the $getEnv function you added to my .mte ...

I seem to have trouble returning anything on these (the links in your .mte utilizing $getEnv did not work). I have the same problem when I just use %UserProfile%\Desktop, for example. I get an error that the file cannot be opened and imbedded links in the export don't work.

Here is what I get when I run your test .mte:

EnvironmentVariableName = Value
APPDATA                = $getEnv(APPDATA)
CLASSPATH              = $getEnv(CLASSPATH)
CLIENTNAME             = $getEnv(CLIENTNAME)
CommonProgramFiles     = $getEnv(CommonProgramFiles)
ComSpec                = $getEnv(ComSpec)
COPYCMD                = $getEnv(COPYCMD)
DIRCMD                 = $getEnv(DIRCMD)
HOMEDRIVE              = $getEnv(HOMEDRIVE)
HOMEPATH               = $getEnv(HOMEPATH)
OS                     = $getEnv(OS)
Path                   = $getEnv(Path)
PATHEXT                = $getEnv(PATHEXT)
ProgramFiles           = $getEnv(ProgramFiles)
SystemDrive            = $getEnv(SystemDrive)
SystemRoot             = $getEnv(SystemRoot)
TEMP                   = $getEnv(TEMP)
TMP                    = $getEnv(TMP)
USERDOMAIN             = $getEnv(USERDOMAIN)
USERNAME               = $getEnv(USERNAME)
windir                 = $getEnv(windir)

I'm on Windows 7 HP 64bit SP1


Anyone other Mp3tag user out there with the same problem?
Florian, what could it be?

'Flskydiver', make sure to use the latest Mp3tag development version 2.48d.
[2011-03-21] NEW: scripting function $getEnv.
[2011-04-18] NEW: support for inbuilt parameters MP3TAGAPP and MP3TAGAPPDATA for $getEnv.


Oh, I'm on 2.48 so maybe that's the problem. I will update and try again.


According to the release notes that should be it, I think - Sorry for the misunderstanding.
(Didn't realize you snuck beta features into my .mte - lol!)

Yep, that did it. My bad!

Thanks for this Detlev.

### Caution ### This script needs version Mp3tag v2.48d ###

I find it is OK with V2.58.