# Put environment variable into tag field

**URL:** https://community.mp3tag.de/t/put-environment-variable-into-tag-field/11722
**Category:** General Discussion
**Created:** [March 15, 2011, 2:24pm UTC](https://community.mp3tag.de/t/put-environment-variable-into-tag-field/11722 "2011-03-15T14:24:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 15, 2011, 2:24pm UTC](https://community.mp3tag.de/t/put-environment-variable-into-tag-field/11722/1 "2011-03-15T14:24:40Z")

</div>

I am sure ... one time there will be coming the moment, when you need the value of an environment variable to create a proper folder path for your music files or to fill a tag-field with some specific external data.

The current version of Mp3tag does not provide access to the system environment variables, so I have created a workaround to do so.

There are two command line utility scripts in the attached zip file:

- GetEnv.AppData.cmd
- GetEnv.Temp.cmd

Run these scripts from any folder.  
Each script will create two files in the folder "%APPDATA%\Mp3tag\data\actions" with the names:

- GetEnv.AppData.mta, GetEnv.AppData.txt
- GetEnv.Temp.mta, GetEnv.Temp.txt

When running the "GetEnv.Temp.mta" action file from within Mp3tag against a selected music file, the action first reads the content of the data file "GetEnv.Temp.txt", then creates a new tag-field of name 'ENV\_TEMP', which holds the folder path string to the current user's TEMP folder.

When running the "GetEnv.AppData.mta" action file from within Mp3tag against a selected music file, the action first reads the content of the data file "GetEnv.AppData.txt", then creates a new tag-field of name 'ENV\_APPDATA', which holds the folder path string to the current user's APPDATA folder.

Hope it is useful, enjoy!

[GetEnv.zip](https://community.mp3tag.de/uploads/default/original/1X/fed17828d26821d1a319947790b0958f9ba02607.zip) (1.47 KB)

DD.20110315.1624.CET

[GetEnv.zip](https://community.mp3tag.de/uploads/default/original/1X/fed17828d26821d1a319947790b0958f9ba02607.zip) (1.47 KB)
