This is the PowerShell script (taken from this post https://forum.rainmeter.net/viewtopic.php?t=32404:
Code: Select all
@echo off
setlocal
set "exe_in=%~1"
set "out_dir=."
set "out_nam=%~3"
echo "ExecutablePath : %exe_in%"
echo "OutputPath : %out_dir%"
echo "OutputName : %out_nam%"
if not "%~2"=="" 2>NUL pushd "%~2" && ( call set "out_dir=%%CD%%" & popd )
set "ico_out=%out_dir%\%out_nam%.ico"
set "psCommand1="Remove-Item(\"%ico_out%\")""
set "psCommand2="[void][Reflection.Assembly]::LoadWithPartialName('System.Drawing');^
[Drawing.Icon]::ExtractAssociatedIcon(\"%exe_in%\").ToBitmap().Save(\"%ico_out%\")""
set "psCommand3="[System.Diagnostics.FileVersionInfo]::GetVersionInfo(\"%exe_in%\").FileDescription""
powershell -noprofile -noninteractive %psCommand1%
powershell -noprofile -noninteractive %psCommand2%
powershell -noprofile -noninteractive %psCommand3%
Code: Select all
[MeasureGetIcon0]
Measure=Plugin
Plugin=RunCommand
Program =#@#Scripts\bat\get-name-and-icon.bat
Parameter="#Path0#" "#@#Icons" "Icon0"
UpdateDivider=-1
OutputFile=Command0.txt
OutputType=ANSI
DynamicVariables=1
Substitute="#CRLF#":""
FinishAction=[!Log "GetIconFinished #Path0#"][!Update][!Redraw]
Code: Select all
"ExecutablePath : C:\Program"
"OutputPath : ."
"OutputName : Foundation\Blender"
Remove-Item : Cannot find path 'C:\Users\ahsan\OneDrive\Documents\Rainmeter\Skins\Rainmeter
Dock\Foundation\Blender.ico' because it does not exist.
- Parameter=""#Path0#" "#@#Icons" "Icon0""
- Parameter="\"#Path0#\" \"#@#Icons\" \"Icon0\""
- Parameter="\'#Path0#\' \'#@#Icons\' \'Icon0\'"
I even tried this (The original author of the script used it in this way):
Code: Select all
[MeasureGetIcon0]
Measure=Plugin
Plugin=RunCommand
Parameter=#@#Scripts\bat\get-name-and-icon.bat "#Path0#" "#@#Icons" "Icon0"
OutputType=ANSI
OutputFile=Command0.txt
UpdateDivider=-1
DynamicVariables=1
Substitute="#CRLF#":""
FinishAction=[!Log "GetIconFinished #Path0#"][!Update][!Redraw]
Code: Select all
'
Been stuck on this for an entire day. Would really appreciate if anyone can help .