Jump to content

how do i create a .bat file to open a app in explorer?


cephead

Recommended Posts

how do i create a .bat file to open a app in explorer? i have one that would open in chrome but would like to know what one for ie would be also. i want it to open in a boxed window not the whole ie page.

here is what im using to open in chrome:

@echo off
start E:\"Program Files"\"Advanced Chrome"\chrome.exe --app="%cd%"\default.html
exit

what would i change to use ie instead?

Link to comment
Share on other sites


First thing you shouldn't use a .bat but rather a .cmd.

Second - even if it might work - you have the double quotes in your example all wrong.

Third - this is only a side note - the start command traditionally has some quirks and it should always be used with the "title" parameter, see:

https://ss64.com/nt/start.html

Fourth you are not launching any "app" in chrome, you are laubching a "normal" .html page in "app mode" (i.e. without the address bar).

I don't think there is an "easy" way to do so from command line (i.e. there isn't AFAIK a correspondent command line parameter to the chrome "--app" one, ther is the "-k" one, but that is "kiosk mode" so it will have no address bar but it will be full screen), you will probably need to use vbs, something *like*:

Set objIE = CreateObject("InternetExplorer.Application")

With objIE
      .visible=1
      .left=200
      .top=200
      .height=800
      .width=600
      .menubar=0
      .toolbar=0
      .statusBar=0
      .FullScreen=0
      .navigate "http://www.google.com"
End With

'Wait until IE has finished loading
Do While objIE.ReadyState <> 4
      WScript.Sleep 100
Loop

Set objIE = Nothing

should do.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

You open notepad.

Then copy the posted text to the notepad window.

Save the file as tryme.vbs in the same directory where the default.html file is.

Then you try running it by double clicking on tryme.vbs or type tryme.vbs on the command line and press [ENTER] or  "cscript tryme.vbs" [ENTER].

If you have .vbs associated to executable it should work, otherwise you ned to set the association, set permissions, etc.

Once by running it you get an Internet Explorer Window opened (whether it actually reaches google or it throws a no connection error is the same) you open the file in Notepad and change the address, "http://www.google.com" in the example, with the path to your "default.html" file (that would probably be simply "default.html" or possibly ".\default.html").

Save the file and run it.

What happens?

jaclaz

 

 

Link to comment
Share on other sites

no luck. the "default.html" at the moment is at "D:\Program Files\Microsoft Games\Spades". the .bat file works great that a friend made for me but it uses chrome to open it.just wanted to know if one could be made to use ie.

Link to comment
Share on other sites

If "no luck" is the complete, detailed, exhaustive description of what happens on your machine, I guess that we can end here our conversation, as it is pretty much pointless.

Go trying helping people ... :(

But if you have a friend that writes .bat files for you, and they "work great", ask him/her to write a new batch capable of starting IE the way you want, you may have better luck :yes:.

Have fun :hello:.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

2 hours ago, Tripredacus said:

Internet Explorer will pass anything into it as an option without the use of a switch. So in the Run box you can test to see if it works:

iexplore "D:\Program Files\Microsoft Games\Spades\default.html"

 

On 10/1/2019 at 9:53 PM, cephead said:

i want it to open in a boxed window not the whole ie page.

:whistle:

jaclaz

Link to comment
Share on other sites

On 10/3/2019 at 9:32 AM, Tripredacus said:

Internet Explorer will pass anything into it as an option without the use of a switch. So in the Run box you can test to see if it works:

iexplore "D:\Program Files\Microsoft Games\Spades\default.html"

it opens in ie but freezes. plus its not boxed its just a complete ie window.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...