can I ever see the code if I use comspec?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dwilbank
Posts: 43
Joined: 15 Mar 2020, 12:59

can I ever see the code if I use comspec?

Post by dwilbank » 16 Sep 2021, 08:43

Code: Select all

:*:purge  ::
runwait %comspec% /k curl -X PURGE %URL% ; <--- this clears the cache of a server that you think is serving you outdated data
return
So I think this is working since my CMD window doesn't show any errors, but what if I want to see the code and the resulting text (which is normally returned when I run this curl command manually)?

Do I have to abandon comspec?

User avatar
mikeyww
Posts: 26602
Joined: 09 Sep 2014, 18:38

Re: can I ever see the code if I use comspec?

Post by mikeyww » 16 Sep 2021, 09:18

This worked for me, in a demo to show the curl version.

Code: Select all

:*:purge::
RunWait, %ComSpec% /k d:\utils\curl.exe -V
Return

RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

Re: can I ever see the code if I use comspec?

Post by RussF » 16 Sep 2021, 09:34

I ran the following code and got a command window with a screenful of text that stayed until I closed it.

Code: Select all

URL := "www.google.com"
runwait %comspec% /k curl -X PURGE %URL%
return
I didn't see in your code where you assigned the value of URL. I tried running it without an assignment and the following text was in the command window:

curl: no URL specified!
curl: try 'curl --help' for more information

Either way, the command window remained. Can't say why yours is disappearing.

garry
Posts: 3740
Joined: 22 Dec 2013, 12:50

Re: can I ever see the code if I use comspec?

Post by garry » 16 Sep 2021, 09:43

@mikeyww's example works for me

Code: Select all

;-https://curl.se/docs/faq.html#What_is_cURL
curlx:="D:\M_GARRY\PROGRAMME_SA\CURL\curl-7.79.0-win64-mingw\bin\curl.exe"
url:="https://media.merriam-webster.com/soundc11/c/curl0001.wav"
;runwait,%comspec% /k %curlx% %url% -S -o curl0001.wav
runwait,%comspec% /k %curlx% -V
;---------------------------------------------------

dwilbank
Posts: 43
Joined: 15 Mar 2020, 12:59

Re: can I ever see the code if I use comspec?

Post by dwilbank » 16 Sep 2021, 10:00

Thanks all.
I guess the problem is that all the urls I've been testing until now return nothing at all.
Google obviously returned that 405 message.
So it's working then. Thanks again!

Post Reply

Return to “Ask for Help (v1)”