Search found 8 matches

by sibianul
21 Jul 2017 02:04
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17029

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

Thank you penpen, now the script works perfectly, I updated my initial bat file, and now I push all the paramenters, not just the freephysicalmemory. So the only thing missing was -q -O ? PS. Now for another PC I will try to modify the script, to add one important thing, this PC is controlling an CN...
by sibianul
19 Jul 2017 23:57
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17029

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

Samir, after typing TYPE TEST it showed what I wanted 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%&freephysi...
by sibianul
19 Jul 2017 11:12
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17029

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

Thank's Igor, it worked, no more errors but still in WebResponse variable I don't have the content of the server response, it seems it's the full date (maybe a part of all headers) With this code: :: Q:\Test\2017\07\08\SU_1226953.cmd @Echo off Pushd "C:\Program Files (x86)\GnuWin32\bin\" S...
by sibianul
19 Jul 2017 10:25
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17029

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

& was unexpected at this time. Escape(add caret) before ampersand too. I don't understand, please can you show me what you mean ? FOR /F "delims=" %%A in ( ' wget.exe "%URL%=%freephysicalmemory%" 2>&1' ) do Set "WebResponse=%%A" Set WebResponse Thank you.
by sibianul
19 Jul 2017 10:11
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17029

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

Oops! Sorry! I asked the wrong question. What does the output of http://192.168.1.40/push.php?loadpercentage=%loadpercentage%&totalphysicalmemory=%totalphysicalmemory%&boottime=%boottime%&freephysicalmemory=%freephysicalmemory% look like? Loading the URL in browser will return 2 or 3 po...
by sibianul
19 Jul 2017 06:42
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17029

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

this is the output, as you can see where it says Dimensiune: 5 [text/html] , in this case the response was SLEEP (5 characters). The response is either empty, OK or SLEEP SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc syswgetrc = c:\Program Files (x86)\GnuWin32/etc/wgetrc --2017-07-19 15:39:36-- http:/...
by sibianul
19 Jul 2017 00:56
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17029

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

Thank you Igor, but it still doesn't work, I tried both codes: FOR /F "delims=" %%A in ( ' wget.exe "%URL%=%freephysicalmemory%" 2^>&1' ) do Set "WebResponse=%%A" Set WebResponse The error with this was : c:\Ovis>wget.bat freephysicalmemory=9843352 & was unexpec...
by sibianul
17 Jul 2017 01:43
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17029

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

hello, I have this batch script to push some values to a RaspberryPi, and I want now to save the response to a variable. I want this as there will be two possible responses so far: one is OK and one is SLEEP. When it will get the SLEEP response I want to run this command to put the computer into sle...