Author Topic: Filter command file arguments  (Read 21471 times)

I.McGoldrick

  • Member
  • *
  • Posts: 5
    • View Profile
Filter command file arguments
« on: 07 Apr 2018, 23:05:12 »
Hello all,

Can someone please explain how the arguments section is passed to the command file in super simple terms (with a how-to preferably).

I've been at this for days, read all the forum threads and googled but I'm getting nowhere. :-[

My objective is to run the following Windows command line which sends a pushover message to my device:

Code: [Select]
curl -s --form-string "token=MYUSERTOKEN" --form-string "user=MYUSERID" --form-string "message=%7" https://api.pushover.net/1/messages.json

where the '%7' is substituted for the filtered message.

I can successfully run this code from a batch file when I write some physical text in the space of '%7'.
However when i run it from PDW I can see no text is being substituted and it fails.

Thanks in advance.

VidarParry

  • Top Member
  • ***
  • Posts: 126
    • View Profile
Re: Filter command file arguments
« Reply #1 on: 08 Apr 2018, 20:16:23 »
Hi,
Is this similar to this topic?:
http://www.discriminator.nl/forum/index.php?topic=896

Cheers
...Steve

I.McGoldrick

  • Member
  • *
  • Posts: 5
    • View Profile
Re: Filter command file arguments
« Reply #2 on: 08 Apr 2018, 20:58:24 »
Hey Steve,

Thanks for the reply, I'm pretty sure it is but I still haven't been able to work it out. Perhaps if i knew what was written inside the .php?

Also seems they have 2 different files, one in each section, i don't know if this is required for me?

Cheers.

VidarParry

  • Top Member
  • ***
  • Posts: 126
    • View Profile
Re: Filter command file arguments
« Reply #3 on: 08 Apr 2018, 21:01:42 »
Suggest you try PM with the author of the other thread. If you get it resolved, please share:-)
Cheers
..Steve

I.McGoldrick

  • Member
  • *
  • Posts: 5
    • View Profile
Re: Filter command file arguments
« Reply #4 on: 09 Apr 2018, 10:08:24 »
Thanks Steve,

Will do in both cases, thanks for the suggestion.

Certainly still keen for general information regarding syntax or anything that will provide a lead...

Regards.

I.McGoldrick

  • Member
  • *
  • Posts: 5
    • View Profile
Re: Filter command file arguments
« Reply #5 on: 10 Apr 2018, 10:59:59 »
SUCCESS!!!

Got it working by a weeks worth of trial and error, but hey, I'm happy!

Here's my solution for a pushover batch file.

Enable command file:
Code: [Select]
C:\WINDOWS\system32\cmd.exe /c

Arguments:
Code: [Select]
curl -s --form-string "token=YOURTOKENHERE" --form-string "user=YOURUSERIDHERE" --form-string "message=%7" https://api.pushover.net/1/messages.json

Thanks Steve and pcolvin for the help.

I.McGoldrick

  • Member
  • *
  • Posts: 5
    • View Profile
Re: Filter command file arguments
« Reply #6 on: 10 Apr 2018, 11:23:58 »
**EDIT**

I guess my solution bypassed the batch file all together in the end.

Its really a windows command line solution.

VidarParry

  • Top Member
  • ***
  • Posts: 126
    • View Profile
Re: Filter command file arguments
« Reply #7 on: 10 Apr 2018, 17:48:24 »
Well done, and thanks for sharing:-)
Cheers
...Steve