It is currently May 11th, 2024, 2:48 am

RunCommand

Share and get help with Plugins and Addons
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: RunCommand 1.0

Post by moshi »

Brian wrote: You might try to run the command directly through cmd.exe with the \U option. You can do this by removing your Program option and use the default one, then add "cscript.exe" to your Parameter option.
Something like this:

Code: Select all

[Command]
Measure=Plugin
Plugin=RunCommand 
Parameter=""cscript.exe" "#@#test.vbs""
Output=Utf16
this doesn't work. the output will be a German Windows error message which basically means "syntax error, path is not correct".

Code: Select all

Parameter="cscript.exe "#@#test.vbs""
works, but the result is Chinese, just as before.


Brian wrote: If that doesn't work, you can manually change the code page inside a batch file using the "mode" command. Something like this: mode con cp select=[Your code page]. You may need to change it back to the original code page after you have run the VBS code.
i guess the correct string for VBS would be Set Locale, this has no effect on the plugin output.


Brian wrote: Unfortunately I am out of town for a couple of weeks and cannot really test or debug this problem at this time.
no worries. i know how to work around this with writing a file from a script and parsing it with the Webparser plugin.
User avatar
Grim
Posts: 59
Joined: February 5th, 2014, 3:44 pm
Location: Canada

Re: RunCommand 1.0

Post by Grim »

moshi wrote: no, i didn't. made-up code usually doesn't work. ;)

the correct key is OutputType, Ascii is not a valid option. and yeah,
Right. Forgot that the plugin only supported the 3. :?
I'll have to play with this and see if I get anything like that cause I'm gonna be running some scripts in the background as well. Just playing with jsmorley's example right now using tasklist to spit out top 10 memory hog processes. ;)
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: RunCommand 1.0

Post by moshi »

it is probably related to WSH using codepage 1250, while the console does not. might also have to do with the plugin using unicode by default.
tried mode con cp select and chcp, but i can't get it to work. not that important though, just wanted to report.
User avatar
Grim
Posts: 59
Joined: February 5th, 2014, 3:44 pm
Location: Canada

Re: RunCommand 1.0

Post by Grim »

So I've dropped the 32bit version of Rainmeter 3.1 onto my USB drive using the portable instll option. I've also dropped the 32bit RunCommand.dll in the plugins folder. When I check the plugins tab in the "About Rainmeter" window it's listed there.

However when I use the RunCommand plugin in my skin I keep getting the error:
Plugin: "RunCommand" not found

Is this plugin supported on/in a "Portable" install?
User avatar
Brian
Developer
Posts: 2693
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: RunCommand 1.0

Post by Brian »

RunCommand works great with a portable install.

Are you sure you included the correct 32-bit RunCommand.dll ? You can download it here: https://github.com/brianferguson/RunCommand.dll/blob/master/PluginRunCommand/x32/Release/RunCommand.dll?raw=true
Just download it, and manually copy/paste it into the Plugins directory of your portable install. It should work fine.

The only way I could replicate your problem is when I placed a 64-bit RunCommand.dll in the plugin folder (under a portable 32-bit Rainmeter install), and tried to use the plugin. For some reason the Plugins tab shows the 64-bit RunCommand.dll (which it should not). We will look into this bug.

-Brian
User avatar
Grim
Posts: 59
Joined: February 5th, 2014, 3:44 pm
Location: Canada

Re: RunCommand 1.0

Post by Grim »

Here's what I have (See screen shots) and the code...

Code: Select all

[MeasureProcessMemory]
Measure=Plugin
Plugin=RunCommand
Parameter=tasklist /NH | sort /+65 /R
OutputFile=#CURRENTPATH#Procbymem.tmp
OutputType=ANSI
FinishAction=[!CommandMeasure MeasureProcessParse "Update"][!UpdateMeasure MeasureProcessParse]
About rainmeter:
3.1.0 r2290 32-bit (May 25 2014)
Windows 7 Enterprise 32-bit (build 7601) Service Pack 1
Path: D:\PortableApps\Rainmeter\
IniFile: D:\PortableApps\Rainmeter\Rainmeter.ini
SkinPath: D:\PortableApps\Rainmeter\Skins\

Still getting the error.
You do not have the required permissions to view the files attached to this post.
User avatar
Brian
Developer
Posts: 2693
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: RunCommand 1.0

Post by Brian »

Can you try this:
32-bit RunCommand.dll.zip
-Brian
You do not have the required permissions to view the files attached to this post.
User avatar
Grim
Posts: 59
Joined: February 5th, 2014, 3:44 pm
Location: Canada

Re: RunCommand 1.0

Post by Grim »

Brian wrote:Can you try this:
32-bit RunCommand.dll.zip
-Brian
:uhuh: Same thing.

Edit: Have a feeling that my Rainmeter install my be messed up somehow. Maybe? :confused:
User avatar
Brian
Developer
Posts: 2693
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: RunCommand 1.0

Post by Brian »

I am at a loss as to why this isn't loading for you.

I have access to the following systems: 32-bit Windows XP, 64-bit Windows 7, and 64-bit Windows 8. I installed Rainmeter 3.1 in both standard and portable mode for each system - and on the 64-bit systems, I also installed Rainmeter in 32-bit mode in both standard and portable mode. After that, I went through all that again with the latest Rainmeter 3.2 beta and in all 20 instances, RunCommand loads and works fine.

The only way I could get your results is when I used the 64-bit plugin on a 32-bit version of Rainmeter.

I don't know what else to say. It looks like RunCommand worked for you at some point (based on your March posts), so maybe there is something wrong with your setup - but I have no idea what it could be. :confused:

One good thing that came out of this, is that I noticed a bug the plugin SDK in which the 64-bit plugins would show "32-bit" in the "product version" text of the properties page - even though the plugin was really 64-bit. Looks like once the bug is fixed, I will probably be updating all my plugins. Of course this bug has nothing to do with your problem though.

-Brian
User avatar
Grim
Posts: 59
Joined: February 5th, 2014, 3:44 pm
Location: Canada

Re: RunCommand 1.0

Post by Grim »

Me too. Tho only thing that I know of that changed is that I installed Rainmeter 3.1 since March. So I'm going to re-install Rainmeter from scratch today and see if that changes anything. I'll let you know.

As for the bug you found, glad something positive came out of my misery. :rofl:

Edit:
Just installed the latest beta.

Code: Select all

3.2.0 beta r2302 32-bit (Jul 14 2014)
Windows 7 Enterprise 32-bit (build 7601) Service Pack 1
Path: D:\PortableApps\Rainmeter\
IniFile: D:\PortableApps\Rainmeter\Rainmeter.ini
SkinPath: D:\PortableApps\Rainmeter\Skins\
Dropped the 32bit RunCommand into the plugins directory (D:\PortableApps\Rainmeter\Plugins\). Same issue. :headbang:

So I ran a ProcessMonitor on it. Turns out it was looking for a MS Visual C++ dll that I did not have on my system. msvcp110.dll to be exact. You can get this DLL via the following MS C++ redistributable package download (Make sure you choose x86 for 32bit, or x64 for 64bit depending on your system/install):
http://www.microsoft.com/en-ca/download/details.aspx?id=30679

With the above installed, RunCommand now works again. :thumbup: