0

My business has been putting out a lot of software, but I'd like to implement a program that checks for updates of our software so our clients are alerted and can then upgrade.

I was thinking of adding a text file on our servers that would display either 0 (no update available) or 1 (update available!) that a batch could read and copy out to a local file.

So I've now uploaded a file (check.txt) that contains just the number '1' and placed on my server. And that's where I've got stuck...

After searching the net, all I could come up with is the following for a batch file:

http://www.mysite/updates/check.txt > update_available.txt

Now, I'm sure I've done something wrong here, as all I'm getting is a blank .txt file.

I'm sure I've missed something crucial here, but despite my searching of the interweb, I simply can't find a solution.

Any ideas?

adam763
  • 3
  • 2
  • possible duplicate of [Is it possible to display the HTML Code of a webpage in a batch file?](http://stackoverflow.com/questions/23502011/is-it-possible-to-display-the-html-code-of-a-webpage-in-a-batch-file) – MC ND Jul 26 '14 at 08:19

2 Answers2

0

Below solution cmay be weird, I've had a similar requirement in the task and I used to do the below. I couldn't find any other solution without any 3rd party tools and especially in a proxy environment.

  1. Create a browser shortcut using chrome or just type the below code in a note pad file and save it as myfiledownload.url

    [InternetShortcut]
    URL=http://www.mysite/updates/check.txt

  2. Make sure that your chrome is your default browser & chrome settings are set to download the files automatically to a path say C:\downloads\

  3. Just use the below lines in your batch. It opens the browser (chrome) and downloads the file to your default download location and you can move it to some other location and do whatever you want. Use the timeout command to give some to open the browser and download the file.

-

@echo off
C:\downloads\myfiledownload.url
timeout /T 10 /nobreak
move c:\downloads\check.txt d:\test\whatever.txt

Cheers. G

gbabu
  • 1,088
  • 11
  • 15
0
:: Get details. Note - options are case-sensitive!
wget -O %workdir%\update_available.txt http://www.mysite/updates/check.txt >NUL 2>NUL

WGET is a free GNU utility, just Google "wget"

Magoo
  • 77,302
  • 8
  • 62
  • 84