Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Getting a returned value from an exe

If you have a question or need help, this is the place to be.
Post Reply
justusiv
Posts: 4
Joined: Wed Mar 28, 2012 6:29 pm

Getting a returned value from an exe

Post by justusiv »

So i am pretty new to EventGhost. Using it because of AutoRemote https://play.google.com/store/apps/deta ... autoremote
Anyways i am needing in EventGhost to return a value from a command line run but am unsure how to do this. For example if you run "wmic bios get serialnumber" on a command line you get a value back. How can i get this value into EventGhost?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Getting a returned value from an exe

Post by Pako »

justusiv
Posts: 4
Joined: Wed Mar 28, 2012 6:29 pm

Re: Getting a returned value from an exe

Post by justusiv »

I actually found that yesterday and was testing it.... I was having a hard time getting anything besides a builtin command to work.. the second i was trying 3rd party exe i was getting no values back.
My other thought was what the first guy was doing. Write everything to a file, then read the contents of the file. It was late and i ran into issues with the file read operations. I will play around with it more today.
justusiv
Posts: 4
Joined: Wed Mar 28, 2012 6:29 pm

Re: Getting a returned value from an exe

Post by justusiv »

Can someone explain why i get giberish from this?
New macro
File Operations: Read text from file: data.txt
Show OSD: {eg.result}

Instead of seeing the data from data.txt
I get garbage. Ideas? If i can get this working I can achieve what i want
I have played with the Input data coding a bit but without luck.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Getting a returned value from an exe

Post by Pako »

justusiv wrote:Can someone explain why i get giberish from this?
New macro
File Operations: Read text from file: data.txt
Show OSD: {eg.result}

Instead of seeing the data from data.txt
I get garbage. Ideas?
I would like to advise you, but I can not.
How can I know what you're doing wrong?

Pako
justusiv
Posts: 4
Joined: Wed Mar 28, 2012 6:29 pm

Re: Getting a returned value from an exe

Post by justusiv »

Well usually when helping someone troubleshoot you go over the basics and mention any "gotchas", maybe ask for any additional information that is needed, see if you can recreate the issue yourself etc
obviously the File Operation - Read text is not functioning the way i think it should. Based on the output i am getting it feels like a file encoding issue but dont know the magic formula to output properaly.

And as i was typing this i figured it out..
The Input Data Coding need to be set to utf_16, or atleast my current data.txt is working with that setting.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Getting a returned value from an exe

Post by Pako »

justusiv wrote:maybe ask for any additional information that is needed
Well, I think it's pretty clear what information is needed. At least:
1) The file from which you want to read
2) Your settings (dialog) of the actions File Operations.Read from text file (preferably screenshot)
justusiv wrote:And as i was typing this i figured it out.
Congratulations!

Pako
kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: Getting a returned value from an exe

Post by kkl »

justusiv wrote:Well usually when helping someone troubleshoot you go over the basics and mention any "gotchas", maybe ask for any additional information that is needed, see if you can recreate the issue yourself etc.
You're the one asking for help and you have the temerity to lecture Pako, of all people, on how he should help you? As he said, your question didn't provide nearly enough information; take some responsibility.

This forum is littered with one-time posters who ask their question and are never heard from again; no follow-up on what happened, and rarely a thank you. It's no wonder that there are so few people left willing to help.
kalia
Experienced User
Posts: 109
Joined: Wed Aug 12, 2009 1:10 am

Re: Getting a returned value from an exe

Post by kalia »

kkl wrote: You're the one asking for help and you have the temerity to lecture Pako, of all people, on how he should help you? As he said, your question didn't provide nearly enough information; take some responsibility.
+1

Don't mess with Pako!
Post Reply