It is currently April 27th, 2024, 6:59 pm

Running VBS script from button

Get help with creating, editing & fixing problems with skins
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Running VBS script from button

Post by LuciferVisuals »

Hello World, Well it started like that a week ago, Now is several interactive .ini Files.

The Specific problem I am having is, I'm trying to make a VBS script run from a button.
The file is: C:\Users\Keith\Documents\Rainmeter\Skins\Stargates\@Resources\Scripts\Exit.vbs

I have tried several things, and from an example somewhere on this forum a developer said ["#@#Scripts\My-Script.vbs"] Should work, but I cannot get it to work. So I added LeftMouseUpAction= to make the line LeftMouseUpAction=["#@#Scripts\Exit.vbs"].

Whatever I do I get a windows error message saying "The system cannot find the specified file". It's probably something really stupid, I only discovered rainmeter a week ago. I am so new to this, I have never used any forum before, and only recently started playing with a computer (at over 70 years of age). So please play nicely.

The Scripts works [perfectly if you mouse click it in it's directory.

My config file that attempting to use it is below. Any other help and advice would be very welcome, but I want to focus on this issue for the time being.

It's Action Button five you are looking for the rest works perfectly, (Though it's probably very badly written) Thanks in anticipation

Code: Select all

[rainmeter]
Author=Lucifer
update=1000
DynamicWindowSize=1
AccurateText=1

[Metadata]
 Name=Remote Control Tablet
 Information=A Remote Control Tablet. Fashioned on the tablet of Ahkmenrah (Night at the Museum - 2006). Originally built to control various Stargate Skins.
 License=Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unsupported
 
 
 
;RUN VBS SCRIPT is probably   LeftMouseUpAction==["#@#Scripts\Launch-Exit-Rainmeter.vbs"]

[Variables]
;******************************************************************************
;                   Messages for Square Actions Buttons
;     The messages that will appear (below remote) on mouseover of buttons
;          Stored as the vqariable #Action-Button-1-Text# ...... ETC!!!
;******************************************************************************

Action-Button-1-Text=Show My Documents
Action-Button-2-Text=Show Rainmeter Skins
Action-Button-3-Text=Show D: Drive
Action-Button-4-Text=Show This Skin
Action-Button-5-Text=Exit Rainmeter VBS
Action-Button-6-Text=Action 6 Not Set
Action-Button-7-Text=Action 7 Not Set
Action-Button-8-Text=Action 8 Not Set
Action-Button-9-Text=Action 9 Not Set
Action-Button-10-Text=PC Sleep. Any Key Wakes
Action-Button-11-Text=Restart Computer
Action-Button-12-Text=Shut down Computer

;***********************************************************************************
;            What event "THIS" set of Action Buttons Will Cause to happen
;               There are 8 sets in total allowing control of 72 events
;      (Plus a hidden set containing system commands that's for experts only)
;        These variables are stored as #Action-Button-1-Event# ...... ETC!!!
;          YOU DONT NEED "LeftMouseUpAction=" ---  Just what comes after
;***********************************************************************************

Action-Button-1-Event=["%USERPROFILE%"]
Action-Button-2-Event=["%USERPROFILE%\Documents\Rainmeter\Skins"]
Action-Button-3-Event=[D:\]
Action-Button-4-Event=["%USERPROFILE%\Documents\Rainmeter\Skins\Stargates"]
;Action-Button-5-Event=["#@#Scripts\Exit.vbs"]      
; couldnt find ["%USERPROFILE%\Documents\Rainmeter\Skins\stargates\@Resources\Scripts\Launch-Exit-Rainmeter.vbs"]
; Couldnt find script ["#@#Scripts\Launch-Exit-Rainmeter.vbs"] 
; TRY ["%USERPROFILE%\Documents\Rainmeter\Skins\stargates\@Resources\Scripts\Launch-Exit-Rainmeter.vbs"]
; TRY C:\Users\Keith\Documents\Rainmeter\Skins\Stargates\@Resources\Scripts
Action-Button-6-Event=
Action-Button-7-Event=
Action-Button-8-Event=
Action-Button-9-Event=
Action-Button-10-Event=[shutdown.exe /h]
Action-Button-11-Event=[shutdown.exe /r /t 0]
Action-Button-12-Event=[shutdown.exe /s /t 0]

;***********************************************************************************
;
;******************* STOP - DO NOT EDIT BELOW THIS LINE ****************************
;******************* UNLESS YOU KNOW WHAY YOU ARE DOING ****************************
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;                                   YOU BREAK IT
;
;                                 YOU FIX IT - LOL
;
;
;
;
;
;
;
;
;
;
;
;
;
;***********************************************************************************
;                       Messages for Round Buttons
;         Well you can change these messages -  BUT THERE IS LITTLE POINT
;     The round button select which function set the square Action buttons use
;      These messages will appear (below remote) on mouseover of round buttons
;          Stored as the vqariable #Remote-Selection-1-Text# ...... ETC!!!   
;******************************************************************************
;Remote-Selection-0-Text=Hidden - EXPERTS ONLY SYSTEM COMMANDS - NO MESSAGE
Remote-Selection-1-Text=File Commands SET 1
Remote-Selection-2-Text=Change Action Buttons to SET 2
Remote-Selection-3-Text=Change Action Buttons to SET 3
Remote-Selection-4-Text=Change Action Buttons to SET 4
Remote-Selection-5-Text=Change Action Buttons to SET 5
Remote-Selection-6-Text=Change Action Buttons to SET 6
Remote-Selection-7-Text=Change Action Buttons to SET 7
Remote-Selection-8-Text=Change Action Buttons to SET 8
;***********************************************************************************
;                            Remote Function Set
;  Number from 1 - 8 which selects functions of square keys ON THIS REMOTE VERSION
;      Suggest leaving this alone till thoroughly familiar with the code
;        You ONLY need to change it if you are making a new remote, 
;************************************************************************************
Remote-Function-Set=1
;Stored as variable #Remote-Function-Set#
;************************************************************************************
;
;************************************************************************************
;   This is the text message under "THIS" remote version... Reminds you what it does
Footer-Message=Set #Remote-Function-Set# Events Files Ect.
;Stored as the variable #Footer-Message#
;
;     This message appears under remote on mouseover of an action key ... 
;                     It tells you what the key does 
;
Footer-Message-2=Select Action
;Stored as variable #Footer-Message-2#
;************************************************************************************

[measurebackgroundFrameCalc]
measure=Calc
formula=counter % 241
substitute=".00000":""
disabled=0
dynamicVariables=1

[meterBackgroundFrame]
meter=Image
ImageTint=255,255,255,255
x=101
y=107
;ImageName=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Images\Controllers\Remote.png
ImageName=#@#Images\Controllers\Remote.png
DynamicVariables=1

[CalcMeasure2500]
Measure=Calc
Formula=Counter %2500

[MeasureTime2500]
Measure=Calc
Formula=CalcMeasure2500

;*************************************************************************************


;*************************************************************************************
;                      Lock PC Button - Small round button (TOP center)   
;                 Activate Remote Button -  Small round button (BOTTOM center)         
;*************************************************************************************
;
[ActivateButton]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Activate2.png
ButtonImage=#@#Buttons\Activate2.png
X=295
Y=660
W=46
H=46
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Go To Standby"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Idle.ini"

[LockButton]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Lock.png
ButtonImage=#@#Buttons\Lock.png
X=291
Y=153
W=46
H=46
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "LOCK COMPUTER"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ToggleConfig "Stargates\Childlock" "Childlock.ini"
;
;*************************************************************************************
;   Round Buttons - SELECTS FUNCTIONS OF THIS REMOTE (Eight sets available)
;                               Top four selections                
;*************************************************************************************
[SelectRemote1button]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\select1.png
ButtonImage=#@#Buttons\Select-#Remote-Function-Set#.png
X=165
Y=145
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-1.ini"

[SelectRemote2button]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Select-#Remote-Function-Set#2.png
ButtonImage=#@#Buttons\Select-#Remote-Function-Set#.png
X=228
Y=145
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-2-Text#"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

[SelectRemote3button]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\select3.png
ButtonImage=#@#Buttons\Select-#Remote-Function-Set#.png
X=341
Y=145
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-3-Text#"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-3.ini"

[SelectRemote4button]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\select4.png
ButtonImage=#@#Buttons\Select-#Remote-Function-Set#.png
X=408
Y=145
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-4-Text#"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-4.ini"

;*************************************************************************************
;                               Bottom four selections                
;*************************************************************************************
[SelectRemote5button]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\select1.png
ButtonImage=#@#Buttons\Select-#Remote-Function-Set#.png
X=164
Y=650
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-5-Text#"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-5.ini"

[SelectRemote6button]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\select2.png
ButtonImage=#@#Buttons\Select-#Remote-Function-Set#.png
X=229
Y=651
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-6-Text#"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-6.ini"

[SelectRemote7button]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\select3.png
ButtonImage=#@#Buttons\Select-#Remote-Function-Set#.png
X=344
Y=652
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-7.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-7-Text#"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]


[SelectRemote8button]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\select4.png
ButtonImage=#@#Buttons\Select-#Remote-Function-Set#.png
X=413
Y=650
LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-8.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-8-Text#"][!UpdateMeter *][!Redraw]
;MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Remote-Selection-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]

;*************************************************************************************
;                            Selection set functions Ends              
;*************************************************************************************
;
;
;*************************************************************************************
;                 Square Set - Select Action Buttons (12 Sets Available) 
;                                     TOP Row of Three            
;*************************************************************************************

[Button-1]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=150
Y=220
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-1-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-1-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

[Button-2]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=265
Y=220
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-2-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-2-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

[Button-3]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=380
Y=220
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-3-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-3-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"
;************************************* Second row of  Three *******************************************

[Button-4]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=150
Y=325
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-4-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-4-Event#;
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

[Button-5]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=265
Y=325
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-5-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=["#@#Scripts\Exit.vbs"]
; TEMP DISABLE TEST VBS LeftMouseUpAction=#Action-Button-5-Event#

[Button-6]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=380
Y=325
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-6-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-6-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

;************************************* Third Row of Three *******************************************
[Button-7]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=150
Y=435
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-7-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-7-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

[Button-8]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=265
Y=435
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-8-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-8-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

[Button-9]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=380
Y=435
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-9-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-9-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

;**************************** Fourth (last) Row of Three *******************************************

[Button-10]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=150
Y=540
;W=105
;H=35
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-10-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-10-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

[Button-11]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=265
Y=540
;W=105
;H=35
; works - once LeftMouseUpAction=!ToggleConfig "Stargates\lock" "lock.ini"
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-11-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-11-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

[Button-12]
Meter=Button
;ButtonImage=%USERPROFILE%\Documents\Rainmeter\Skins\Stargates\@Resources\Buttons\Button Test2.png
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=380
Y=540
;W=105
;H=35
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-12-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=#Action-Button-12-Event#
;LeftMouseUpAction=!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-2.ini"

;**************************** Action Buttons End *******************************************
;
;************************************** Footer ******************************************
[HideButtons]
Meter=Button
ButtonImage=#@#Buttons\Show-Hide-Buttons.png
X=130
Y=745
;h=30
;w=590
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Hide Buttons"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]

Buttoncommand=!Execute [!RainmeterHideMeter lockbutton] [!RainmeterHideMeter SelectRemote1button] [!RainmeterHideMeter SelectRemote2button] [!RainmeterHideMeter SelectRemote3button] [!RainmeterHideMeter SelectRemote4button] [!RainmeterHideMeter SelectRemote5button] [!RainmeterHideMeter SelectRemote6button] [!RainmeterHideMeter SelectRemote7button] [!RainmeterHideMeter SelectRemote8button] [!RainmeterHideMeter Button-1] [!RainmeterHideMeter Button-2] [!RainmeterHideMeter Button-3] [!RainmeterHideMeter Button-4] [!RainmeterHideMeter Button-5] [!RainmeterHideMeter Button-6] [!RainmeterHideMeter Button-7] [!RainmeterHideMeter Button-8] [!RainmeterHideMeter Button-9] [!RainmeterHideMeter Button-10] [!RainmeterHideMeter Button-11] [!RainmeterHideMeter Button-12] [!RainmeterHideMeter ActivateButton] [!RainmeterShowMeter Showbuttons] [!RainmeterHideMeter hidebuttons]
;Buttoncommand=!Execute [!RainmeterHideMeter Button-12] [!RainmeterHideMeter Button-11] [!RainmeterShowMeter Showbuttons]

[ShowButtons]
Meter=Button
ButtonImage=#@#Buttons\Show-Hide-Buttons.png
;ButtonImage=#@#Buttons\Remote-#Remote-Function-Set#.png
X=470
Y=745
;h=30
;w=590
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Show Buttons"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]

Buttoncommand=!Execute [!RainmeterShowMeter lockbutton] [!RainmeterShowMeter SelectRemote1button] [!RainmeterShowMeter SelectRemote2button] [!RainmeterShowMeter SelectRemote3button] [!RainmeterShowMeter SelectRemote4button] [!RainmeterShowMeter SelectRemote5button] [!RainmeterShowMeter SelectRemote6button] [!RainmeterShowMeter SelectRemote7button] [!RainmeterShowMeter SelectRemote8button] [!RainmeterShowMeter Button-1] [!RainmeterShowMeter Button-2] [!RainmeterShowMeter Button-3] [!RainmeterShowMeter Button-4] [!RainmeterShowMeter Button-5] [!RainmeterShowMeter Button-6] [!RainmeterShowMeter Button-7] [!RainmeterShowMeter Button-8] [!RainmeterShowMeter Button-9] [!RainmeterShowMeter Button-10] [!RainmeterShowMeter Button-11] [!RainmeterShowMeter Button-12] [!RainmeterShowMeter ActivateButton] [!RainmeterShowMeter LockButton] [!RainmeterHideMeter showbuttons] [!RainmeterShowMeter hidebuttons]
;[!RainmeterShowMeter SelectRemote1button] [!RainmeterShowMeter SelectRemote2button] [!RainmeterShowMeter SelectRemote3button] [!RainmeterShowMeter SelectRemote4button] [!RainmeterShowMeter SelectRemote5button] [!RainmeterShowMeter SelectRemote6button] [!RainmeterShowMeter SelectRemote7button] [!RainmeterShowMeter SelectRemote8button] [!RainmeterShowMeter Button-1] [!RainmeterShowMeter Button-2] [!RainmeterShowMeter Button-3] [!RainmeterShowMeter Button-4] [!RainmeterShowMeter Button-5] [!RainmeterShowMeter Button-6] [!RainmeterShowMeter Button-7] [!RainmeterShowMeter Button-8] [!RainmeterShowMeter Button-9] [!RainmeterShowMeter Button-10] [!RainmeterShowMeter Button-11] [!RainmeterShowMeter Button-12] [!RainmeterShowMeter ActivateButton] [!RainmeterShowMeter LockButton] [!RainmeterHideMeter showbuttons] [!RainmeterShowMeter hidebuttons]
Hidden=1
;************************************

;The Name Tag for this set of Action Buttons (The "ini" file in use.)
[Remote #Remote-Function-Set#]
Meter=Image
ImageName=#@#Text-Images\Remote-#Remote-Function-Set#.png
X=190
Y=745
W=250
H=35

[MeterString-Footer-Message]
Meter=String
StringAlign=Center
x=320
y=775
FontSize=15
FontWeight=500
;FontColor=51,51,0,255
FontColor=209,206,113,255
SolidColor=0,0,0,1
AntiAlias=1
Text=#Footer-Message#
; = VERSION OF REMOTE ACTIVE: "Function Set 1 Active" MEANS "Remote-Active-1.ini" Loaded
MouseOverAction=[!SetOption MeterString-Footer-Message FontColor "0,0,0,255"][!SetOption MeterString-Footer-Message Text #Footer-Message#][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-Message FontColor "209,206,113,255"][!SetOption MeterString-Footer-Message Text #Footer-Message#][!UpdateMeter *][!Redraw]

[MeterString-Footer-2]
Meter=String
StringAlign=Center
x=320
y=800
FontSize=18
FontWeight=500
FontColor=139,139,139,255
SolidColor=0,0,0,1
AntiAlias=1
Text=#Footer-Message-2#

;**********************************  Footer Ends *****************************************
;
;*******************************************************************************************
Last edited by balala on April 11th, 2023, 9:08 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

BTW I just noticed I still had a couple of execute commands, I thought I removed them all, they are gone now but are not related to the actual problem.

Sorry I have not worked out how to do a screen shot yet. Never used one before don't laugh. But I managed to paste the clipboard into a wordpad doc and attached it.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16178
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Running VBS script from button

Post by balala »

LuciferVisuals wrote: April 11th, 2023, 7:40 pm Whatever I do I get a windows error message saying "The system cannot find the specified file".
You should have to have the Exit.vbs file into the Scripts folder, which has to be in the @Resources folder of your config. Check the config you're working in. This is the first folder into the Skins folder (the place of this Skins folder usually is C:\Users\YourName\Documents\Rainmeter\Skins, but this is not mandatory, the folder might be into another location in some cases), which contains the .ini file of your skin, which has the posted code. If you don't know what is your config, right click the skin and check the first element of the menu. It is the name of the config in which the skin you've right-clicked resides. Check the first folder of this path, if there are more folders, that being the name of the root config. For instance if the first elemnet of the menu is MySkin\Skin1, the name of the root config is MySkin and it is located into the Skins folder. The @Resources folder is placed into this folder. Open it and check if the Scripts folder does exist. If it does, open it and check if the Exit.vbs file does exist. I assume (at least) one of these elements are not there or has another name than the one listed above.
So is the Exit.vbs file there? What is its exact path?
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Thank you for a prompt response.

I think this answers what you ask.

My Rainmeter skins are in the following directory

C:\Users\Keith\Documents\Rainmeter\Skins ...
My Skin is called stargates and I think of it as the root directory of my skin and everything related to my skin is in there. So that's at: C:\Users\Keith\Documents\Rainmeter\Skins\Stargates ....

That directory contains:

@Resources, together with;

Little-remote.ini (What I think of as my boot up skin)
So thats C:\Users\Keith\Documents\Rainmeter\Skins\Stargates\Little-Remote.ini
That directory also contains sub directories (folders) one of which is called
Remote-Idle, and in that directory are several .ini files including the one that's trying to use the offending VBS script. It's name is "Remote-Active-1.ini" (that's the code I sent with my post)

So C:\Users\Keith\Documents\Rainmeter\Skins\Stargates\Remote-Idle\Remote-Active-1.ini. Is trying to use a VBS when the Rainmeter Button is clicked.

I have checked and confirmed that The VBS Script is where I intended it to be and is called "Exit.vbs" and works if you manually click on it, it's located at:- C:\Users\Keith\Documents\Rainmeter\Skins\Stargates\@Resources\Scripts\Exit.Vbs

I'm using various "stacked" variables that complicate the issue - just a bit. So (Just to get this working) I simplified the original code (temporarily as a proof on concept), but it still does not work. Also I just removed some of my comments about what didn't work, to make it easier for you to see the active code which is below; Its the last line that attempts to use the script.

Code: Select all

[Button-5]
Meter=Button
ButtonImage=#@#Buttons\Action-#Remote-Function-Set#.png
X=265
Y=325
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "#Action-Button-5-Text#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]

LeftMouseUpAction=["#@#Scripts\Exit.vbs"]
Thanks - Keith
Last edited by balala on April 12th, 2023, 3:35 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16178
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Running VBS script from button

Post by balala »

LuciferVisuals wrote: April 12th, 2023, 8:04 am I think this answers what you ask.
Extremely exhaustive description, thanks for it. To be honest I don't realize what is the issue, so can recommend only to try out a few things, maybe we'll realize where the problem resides.
  • For first, please check the encoding of the Remote-Active-1.ini file. It should have to be UTF-16 LE. If it's anything else, please recode it as UTF-16 LE and try to use it once again, to see if this fixed the issue (I doubt it does, but still).
  • If it didn't, try replacing the LeftMouseUpAction=["#@#Scripts\Exit.vbs"] option with LeftMouseUpAction=["C:\Users\Keith\Documents\Rainmeter\Skins\Stargates\@Resources\Scripts\Exit.Vbs"] (ugly solution, but it's meant just to make sure the path is exactly the one needed, however I doubt this would help in anyway).
  • If the above still didn't help, replace back the LeftMouseUpAction option with the original one, copy another file beside Exit.vbs. It could be for instance an image. Than alter the file name in the LeftMouseUpAction to the newly added file, to get opening that one when you click the meter. I want to check if the click does open another file placed into the same folder as Exit.vbs. So if for instance you copy a file called MyImage.png next to Exit.vbs, replace the LeftMouseUpAction option with LeftMouseUpAction=["#@#Scripts\MyImage.png"]. Try clicking now the meter. Does it open the image into the default image viewer?
  • Finally if it doesn't, please pack the whole Skins\Stargates config and upload the package here, to can check (because I have no clue at all what's going on there).
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Running VBS script from button

Post by Yincognito »

LuciferVisuals wrote: April 12th, 2023, 8:04 amSo (Just to get this working) I simplified the original code (temporarily as a proof on concept), but it still does not work.
Besides what balala advised, try this and see if it works (the only difference is that the parent folder is called StargatesTest instead of just Stargates, so that it doesn't by any chance mess up your already existing skin):
StargatesTest_1.0.0.rmskin
This will simply demonstrate that it should work via speaking... ;-)
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Hi Guys thanks I'll attempt to try those things.

Sorry for the exhaustive description, I wasn't sure what you wanted TBH. But wanted to ensure I gave you what you needed.

I'm in my seventies, and was given an old computer for Christmas as an alternative to day time TV. (Also a good alternative to sleep). The Last three months have been a "cliff face" of a learning curve and basically I still feel like I have no idea what I'm doing. That said everything works except this VBS part.

I have no idea what UTF-16 LE is, never heard of it, Also no idea what language I coded my skin in, I really did start with your hello world example in the tutorial and started adding bits to it by trial and error, after two weeks it had got to what I sent you, and half that fortnight was spent on making graphics for it. I'm amazed and impressed that it works.

I googled UTF-16 LE and its and something to do with unicode? But atm no idea what that is either.... BUT who needs to sleep.

THIS MIGHT BE IMPORTANT TO OTHER USERS
SYSTEM RESTORE DELETED MY .ini Files - Didn't expect that!!!

I had to use restore because I wrote some other VBS scripts one of which was to hide and restore the desktop Icons, (makes rainmeter look so much better), anyway the script hid them but I couldn't get them back, even in windows, so I did a system restore, which worked but deleted my .ini files. (I have fixed those scripts) and they work perfectly at least in windows.

BUT NOW COPY MY ENTIRE SKIN TO MY D: DRIVE EVERY NIGHT

I assume I can just copy and paste it back over the working one in rainmeter to over-write it in case that happens again?

OH prob not relevant but just in case. IT'S ACTUALLY A BATCH FILE THAT'S doing the work, (Or supposed to)... All the VBS script does is make the batch file run invisibly.

This is the VBS SCRIPT called "exir.vbs"

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "%USERPROFILE%\Documents\Rainmeter\Skins\Stargate\@Resources\scripts\Exit-Rainmeter.bat" & Chr(34), 0
Set WshShell = Nothing

And this is the batch file, called "Exit-Rainmeter.bat"

@echo off
taskkill /F /im Rainmeter.exe

BRILLIANT NOW IT'S #*$%ING OBVIOUS WHAT THE PROBLEM IS !!!!!!

So glad I wrote a long boring post or I would not have spotted it Thanks so much for your time and patience. it's fixed now and works I just tested it. I have several other cool scripts, once I finish this I'll post the entire project somewhere so others can use it and them

The problem was caused by that system restore, I had to largely start over, but rather than start entirely from scratch I kept what the system restore did not destroy which was originally in a directory called "Stargate" and started afresh with a new directory called Stargate"S". then tested and copied bits over one at at time into the new working directory. I FORGOT TO CHANGE THE PATH in the vbs script.

But to be fair a simple typo in the scripts path would have caused exactly the same mistake and error message.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Big ask under the circumstances.

But anyone willing to read the original .ini file in my original post and give me a heads up as to anything I'm doing wrong in general. Stuff that could cause me problems down the line. As I said I built it by trial and error, the fact that it works doesnt mean its the right way to do it.

Thanks again.

Keith

PS might want to mention elsewhere that Windows 7 System restore "might" delete .ini files that are using vbs scripts, ironically, it didn't delete the offending script, or the batch file the script called.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

sorry typo in first post

"This is the VBS SCRIPT called "exir.vbs"

Its not that should read ]

"This is the VBS SCRIPT called "exit.vbs" But job done
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Running VBS script from button

Post by CodeCode »

LuciferVisuals wrote: April 13th, 2023, 6:01 am Big ask under the circumstances.

But anyone willing to read the original .ini file in my original post and give me a heads up as to anything I'm doing wrong in general. Stuff that could cause me problems down the line. As I said I built it by trial and error, the fact that it works doesnt mean its the right way to do it.

Thanks again.

Keith

PS might want to mention elsewhere that Windows 7 System restore "might" delete .ini files that are using vbs scripts, ironically, it didn't delete the offending script, or the batch file the script called.
You might look into RunCommand Plugin. That way you can choose which directory to start making commands from.

Also, there is this:
Hide-Show Desktop Icons (Win 7, 8, 10).zip
It works like this and will toggle the state of your desktop icons: LeftMouseUpAction=["#@#Hide-Show Desktop Icons (Win 7, 8, 10).exe"]

I hope those things help you get things working as intended even further as now.
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.