It is currently March 19th, 2024, 6:38 am

!WriteKeyValue how to overcome filepath limitations

Get help with installing and using Rainmeter.
Post Reply
LordgodEric
Posts: 10
Joined: April 21st, 2013, 1:46 pm

!WriteKeyValue how to overcome filepath limitations

Post by LordgodEric »

I understand the reasoning behind the path limitations on the !WriteKeyValue bang to keep a skin from messing up other programs or data outside of its purview.
But :lol:, that is exactly what I'm trying to accomplish. Is there any way to overcome these limitations, change a file outside of the scope of the Rainmeter application. I know I could go through lua to access the file, but then I would need to read the file, parse for the single item I need to change, then write the file back. It would be so much easier to use this bang as the file I am trying to change is exactly setup as an ini file even though it is for another program.

Thanks for any help.
Last edited by LordgodEric on November 7th, 2019, 12:33 pm, edited 1 time in total.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: !WriteKeyValue how to overcome filepath limitations

Post by mak_kawa »

Just an idea. How about creating hardlink for the "outside" file?

Command to make hardlink is fsutil hardlink create (link filepath) (target filepath).

I have actually tested this method, and confirmed that !WriteKeyValue bang can write value to the *.inc file located "outside" of #SKINSPATH# and #SETTINGSPATH#.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: !WriteKeyValue how to overcome filepath limitations

Post by mak_kawa »

Oops...sorry, Windows hardlink has some limitations and problems (at least for me). "Symbolic link" seems to me far better.
Command for making symbolic link is mklink (link filepath) (taget filepath).
LordgodEric
Posts: 10
Joined: April 21st, 2013, 1:46 pm

Re: !WriteKeyValue how to overcome filepath limitations

Post by LordgodEric »

mak_kawa wrote: November 6th, 2019, 1:32 pm Oops...sorry, Windows hardlink has some limitations and problems (at least for me). "Symbolic link" seems to me far better.
Command for making symbolic link is mklink (link filepath) (taget filepath).
Thanks so much the symbolic link worked perfectly. Just needed to read the full info on the command to figure exactly how to do it. https://ss64.com/nt/mklink.html. And most important the command had to be issued from one of the folders (I used the #SKINSPATH#) and then link through that path in the code.
Post Reply