how to save response of wget.exe in a variable?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: how to save response of wget.exe in a variable?

#16 Post by Samir » 23 Jul 2017 15:58

sibianul wrote:Samir, after typing TYPE TEST it showed what I wanted :)

Code: Select all

C:\Users\Ovidiu>c:\"Program Files (x86)"\GnuWin32\bin\wget.exe --output-document=TEST "http://192.168.1.40/push.php?loadpercentage=%loadpercentage%&totalphysicalmemory=%totalphysicalmemory%&boottime=%boottime%&freephysicalmemory=%freephysicalmemory%"
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = c:\Program Files (x86)\GnuWin32/etc/wgetrc
--2017-07-20 08:48:32--  http://192.168.1.40/push.php?loadpercentage=%25loadpercentage%25&totalphysicalmemory=%25totalphysicalmemory%25&boottime=%25boottime%25&freephysicalmemory=%25freephysicalmemory%25
Connecting to 192.168.1.40:80... conectat.
Cerere HTTP trimisă, se aşteaptă răspuns... 200 OK
Dimensiune: 5 [text/html]
Saving to: `TEST'

100%[==============================================================================>] 5           --.-K/s   in 0s

2017-07-20 08:48:33 (181 KB/s) - `TEST' saved [5/5]


C:\Users\Ovidiu>TYPE TEST
SLEEP
C:\Users\Ovidiu>


I found the other files also, wget was saving files in my Windows User folder, and the last one was the TEST file, and it contained the response of my server, the word SLEEP :) Now what ?
penpen got it. 8)

The results were being written to these files and then you could have read in the file and put it into the variable Webresponse, but penpen used a method to get the results directly into the variable. 8) Because he's smart like that. :mrgreen: 8)

Post Reply