Add a new item that shows output of program?

Forums Desktop Info Add a new item that shows output of program?

This topic contains 3 replies, has 2 voices, and was last updated by Glenn Glenn 4 months ago.

  • Author
    Posts
  • #1854 Reply
    Avatar
    Michael

    To show my current git branch in Desktop Info, I save output of the command “git symbolic-ref –short HEAD” to a file. Is it possible to add a new Item that will run a command line program and display the output?

    Something like this:
    #Show Windows Version:
    EXECUTE=active:1,interval:0,text:Windows Version:,cmd=ver.exe

    0
  • #1857 Reply
    Glenn
    Glenn
    Keymaster

    yes but it takes two items:

    use CMD to execute whatever command or tool you want. this command needs to send it’s output to a temp file somewhere.

    use FILECONTENTS1 or FILECONTENTS2 to display the temp file contents.

    0
  • #1859 Reply
    Avatar
    Michael

    The windows “>” and “>>” will do the trick to save the output to the file:
    #Save Windows version to the winver.txt
    EXECUTE=active:1,interval:0,text:Windows Version:,cmd=ver.exe > winver.txt

    What about the program parameters? Do the CMD value should be quoted?
    EXECUTE=active:1,interval:0,text:Test:,cmd=”prog.exe /param1 /pama2 > output.txt”

    0
  • #1860 Reply
    Glenn
    Glenn
    Keymaster

    check the manual for details

    0
Reply To: Add a new item that shows output of program?
Your information:




Do NOT follow this link or you will be banned from the site!