Any way to escape an environment variable?
Example:
!WriteKeyValue Variables Vari01 """%*USERNAME*%"""
It is currently April 18th, 2024, 8:46 am
Escaping %Environment% variables?
-
- Posts: 268
- Joined: May 12th, 2019, 8:55 am
-
- Posts: 268
- Joined: May 12th, 2019, 8:55 am
Re: Escaping %Environment% variables?
Before Jeff's sarcastic reply,
Use:
Thanks jeff.
Use:
Code: Select all
!WriteKeyValue Variables Vari01 "[\x0025]USERNAME[\x0025]"
-
- Posts: 327
- Joined: September 3rd, 2018, 11:18 am
Re: Escaping %Environment% variables?
Welp, it should work like other variables, Rainmeter only uses #, $ and & characters in variables so it shouldn't be a problem.
So let's try [!SetVariable Username "%*USERNAME*%"]
Oh... that didn't work
Ok, you know, Rainmeter may sometime use rainmeter.exe from %AppData% for some stuff, so let's try to escape it like in CMD.
So let's try [!SetVariable Username "^%USERNAME%"]
Oh... that didn't work either... what the hell
You know what? When all hope is lost you have to add some duct tape. Let's try to make the percent signs character variables.
So let's try [!SetVariable Username "[\x0025]USERNAME[\x0025]"]
Hey, that worked! Not the best way to discover escaping enviourment variables but it's something, I think you should add [Suggestion] to the thread name so it's more understandable
So let's try [!SetVariable Username "%*USERNAME*%"]
Oh... that didn't work
Ok, you know, Rainmeter may sometime use rainmeter.exe from %AppData% for some stuff, so let's try to escape it like in CMD.
So let's try [!SetVariable Username "^%USERNAME%"]
Oh... that didn't work either... what the hell
You know what? When all hope is lost you have to add some duct tape. Let's try to make the percent signs character variables.
So let's try [!SetVariable Username "[\x0025]USERNAME[\x0025]"]
Hey, that worked! Not the best way to discover escaping enviourment variables but it's something, I think you should add [Suggestion] to the thread name so it's more understandable
For reference, gave the answer a few mins ago before reply and suggested the forum post