1

Following code in ".bat" file opens browser. I don't want to open browser.

File Name: mytest.bat

Code:

@echo off
start "" http://192.xxx.x.xxx/root/api/v3/async/batch

Is there any mechanism to keep the browser hidden while open URL? Or any alternative way?

Please guide me.

Nanji Mange
  • 2,155
  • 4
  • 29
  • 63
  • `Is there any mechanism to keep the browser hidden while open URL` - Are you trying to get/post data from some api/service? – Pankaj Jaju Feb 08 '18 at 14:16
  • check [this](https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/winhttpjs.bat) - you can perfromt `POST`,`GET` .. queries and save the result as a file. – npocmaka Feb 08 '18 at 14:19
  • @PankajJaju I just open a url everyday for testing purpose. I don't want browser opens everytime when my batch file runs. Please suggest – Nanji Mange Feb 08 '18 at 14:22
  • What is that URL doing? Also, why vbscript tag? – Pankaj Jaju Feb 08 '18 at 14:24
  • 1
    @NanjiMange the web browser is opening because you're asking the `cmd` interpreter to "execute" a URL. It will therefore search for the default program on your system that opens URLs which is your browser. If you need the URL for a specific reason other than viewing it in a web browser you are most probably tackling your problem the wrong way. What are you trying to achieve by "executing" the URL? – J.Baoby Feb 08 '18 at 16:18
  • @J.Baoby URL triggers the page of my website that start synchronization of our data. I don't thing this is really concern but the point is I want to keep hide the browser. I can use internet explorer browser as it is default in all windows system. Please suggest me. – Nanji Mange Feb 09 '18 at 04:44
  • 2
    @NanjiMange if all you want is to trigger the page (probably with a HTTP `GET` request), use tools designed to send simple HTTP requests without the need of visualizing anything such as [cURL](https://curl.haxx.se/download.html), [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or the tool @npocmaka suggested in [his comment](https://stackoverflow.com/questions/48687425/how-to-stop-batch-file-to-open-browser?noredirect=1#comment84373092_48687425). Feel free to poll me if you need help with these, I'll then elaborate in an answer. – J.Baoby Feb 09 '18 at 12:05
  • @NanjiMange found [this StackOverflow post](https://stackoverflow.com/questions/20782734/open-a-url-without-using-a-browser-from-a-batch-file). It will probably help you. – J.Baoby Feb 09 '18 at 13:32
  • 1
    You Can Use `Internet Explorer` In Vbscript. –  Sep 22 '19 at 17:14

0 Answers0