-1
I have many variables in the PATH and I want to export and reuse them.
Is that possible? (something like a .reg file)
-1
I have many variables in the PATH and I want to export and reuse them.
Is that possible? (something like a .reg file)
1
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
Path is just one variable. At the command line type:
echo %PATH%
to see it's value. Nearly all languages support a way to access environmental variables already but you haven't asked for anything specific. If you want all of them type:SET
– krowe – 2014-11-12T13:37:11.713@krowe Works perfect! Many thanks. And if I want to revert I'll type:
SET %PATH% "paths"
? – tvl – 2014-11-12T13:40:15.537Type
SET TMP=%PATH%
to create a new copy for just this session. TypeSET PATH=%PATH%;C:\newdir
to append. – krowe – 2014-11-12T13:43:33.503@krowe Perfect! Write it as an answer to approve it. btw it was so dum question for the downvotes? – tvl – 2014-11-12T13:45:47.970
It'll probably get deleted\merged because I'm sure this has been asked before. – krowe – 2014-11-12T13:51:27.030