I have many variables in the PATH and I want to export and reuse them.
Is that possible? (something like a .reg file)
51 Answer
Nearly all languages support a way to access environmental variables already but you haven't asked for anything specific so we'll assume that you want to do this from the command line. Path is just one variable. At the command line type: echo %PATH% to see it's value.
If you want all of the environmental variables listed then type: SET by itself.
Type SET TMP=%PATH% to create a new copy for just this session.
Type SET PATH=%PATH%;C:\newdir to append to it.
To loop through %PATH% use this: for %a in ("%path:;=";"%") do @echo %~a