It is currently April 18th, 2024, 11:52 pm

Renaming HDDs with TextInput

Get help with creating, editing & fixing problems with skins
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Renaming HDDs with TextInput

Post by StArL0rd84 »

So i want my HDD skin to be able to edit the label of the drives (within windows)
And i found a relatively easy way through CMD, and i'm using RunCommand to do it.
Example: label C:NewLabel

I'm just having a hard time combining TextInput with Runcommand.

1. TextInput sets the parameter of Runcommand.
2. TextInput should then fire the Runcommand after hitting enter, but it does not.

[!SetOption mCommandLabel3 ParaMeter "label [Drive3]$UserInput$"] DefaultValue="[mHDD3Label]" [!CommandMeasure mCommandLabel3 "Run"]

I gotta fire Runcommand manually afterwards which is what i would like to avoid.

Made a little examle skin, and set it to read the label of drive 3 since it's the flash drive im testing on my system.
hddddd.png
RenameHDD_1.0.rmskin
You do not have the required permissions to view the files attached to this post.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Renaming HDDs with TextInput

Post by jsmorley »

In [HDD3Text] you have:

LeftMouseUpAction=[!CommandMeasure "Input ExecuteBatch 3"]

As the error log is clearly telling you, you must have two parameter on a !CommandMeasure bang. The first is the measure to command, and the second is the command to send it.

So:

LeftMouseUpAction=[!CommandMeasure "Input" "ExecuteBatch 3"]

Aside from that, this doesn't work for me anyway.

I'm pretty sure that using that command requires an elevated command prompt. Which would likely require running Rainmeter "As administrator". This is because Windows doesn't want people to create Rainmeter skins that mess with important system settings... Anyway, I hate whole idea so much I can't really dig any further into it.

;-)
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Renaming HDDs with TextInput

Post by StArL0rd84 »

Thank you for your input, and i do agree.
Rainmeter should not be a "doorway" to important windows SETTINGS.
But personally i wouldn't categorize a HDD Label as a setting.

Since my HDD skin reads the label of the actual drives,
I wanted to provide an convenient way of changing them instead of going into ThisPC and doing it.
And only the C drive requires administrator permission to rename it.
So i wont be able to change the label of that drive from here.

Anyways, with all that said, i found a way after a good nights sleep ;P
Never used OnChangeAction on InputText before...

Code: Select all

[mChangeLabel]
 Measure=Plugin
 Plugin=RunCommand
 ParaMeter=
 DynamicVariables=1
 State=Hide

[Input]
 Measure=Plugin
 Plugin=InputText.dll
 X=140
 Y=-40
 H=14
 W=290
 AntiAlias=1
 FontSize=10
 SolidColor=#TextBarsColor#
 FontColor=#TextColor2#
 FocusDismiss=1
 MeterStyle=TextStyle
 StringAlign=Center
 OnChangeAction=[!CommandMeasure "mChangeLabel" "Run"]
 OnDismissAction=
 InputLimit=32
 Command1=[!SetOption mChangeLabel ParaMeter "label [Drive1]$UserInput$"] DefaultValue="[mHDD1Label]"
 Command2=[!SetOption mChangeLabel ParaMeter "label [Drive2]$UserInput$"] DefaultValue="[mHDD2Label]"
 Command3=[!SetOption mChangeLabel ParaMeter "label [Drive3]$UserInput$"] DefaultValue="[mHDD3Label]"
 Command4=[!SetOption mChangeLabel ParaMeter "label [Drive4]$UserInput$"] DefaultValue="[mHDD4Label]"
 Command5=[!SetOption mChangeLabel ParaMeter "label [Drive5]$UserInput$"] DefaultValue="[mHDD5Label]"
 Command6=[!SetOption mChangeLabel ParaMeter "label [Drive6]$UserInput$"] DefaultValue="[mHDD6Label]"
 Command7=[!SetOption mChangeLabel ParaMeter "label [Drive7]$UserInput$"] DefaultValue="[mHDD7Label]"
 Command8=[!SetOption mChangeLabel ParaMeter "label [Drive8]$UserInput$"] DefaultValue="[mHDD8Label]"
 Command9=[!SetOption mChangeLabel ParaMeter "label [Drive9]$UserInput$"] DefaultValue="[mHDD9Label]"
 Command10=[!SetOption mChangeLabel ParaMeter "label [Drive10]$UserInput$"] DefaultValue="[mHDD10Label]"
 DynamicVariables=1
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Renaming HDDs with TextInput

Post by jsmorley »

Great. Glad you figured it out.