Home Ask Login Register

Developers Planet

Your answer is one click away!

Gab February 2016

Create shortcut, that opens a website and reload it after x ms

We've just upgraded group policies at work because of a big migration project. Nevermind... The thing is, some of our users use this java application, which reads the smart card reader. On new machines it doesn't work in IE, it has to run in firefox. The trouble is, that the first time firefox opens it, it says there's no java. As soon as you reload it, it's fine.

As users are users, they hate the thought of having to reload the page, and it's not very elegant either. As the process of upgrading anything in the company is difficult, and I'm only an entry level desktop support guy, it won't get fixed any time soon.

So I was thinking... is there any way to create a shortcut, that would open the page and then reload it once it finishes loading the first time?

It can be a shortcut to a local html file which then redirects it to the final location...


Paedow February 2016

You can use a vbs:

set WScriptShell = CreateObject("WScript.Shell")
WScriptShell.SendKeys "{F5}"

This one opens a page in the browser, waits 2000 ms (probably enough for the page to load) and then sends the "F5" key to the currently active window. This may not be a perfect solution, but you can extend it to match your needs.

hepifish February 2016

Have you tried $( document ).ready() and insert the code in this function? This basically waits your whole page to load and after that executes the code in the function.

Post Status

Asked in February 2016
Viewed 3,349 times
Voted 10
Answered 2 times


Leave an answer

Quote of the day: live life