Link to home
Start Free TrialLog in
Avatar of AdminAssociates
AdminAssociates

asked on

How can I set the default browser from the command line or from a Powershell script in Win7?

Does anyone know of a way to set the default browser using PowerShell, a batch file, or simply from the command line from a Win7 unit?
When you create a web page it is best to see all of your changes through the "eyes" of several of the more popular browsers since they tend to render the page slightly differently (sometimes more than slightly).  What looks good in IE or Chrome may not be so well aligned in Firefox.
I know how to change default browsers, but the normal ways are clumsy and time consuming. There must be a way to make the changes via PowerShell or from the command line.  After all, isn't it really just a matter of registry settings?
Any help would be appreciated.
Avatar of Run5k
Run5k
Flag of United States of America image

If you don't mind me saying so, I have never found that changing the default browser is particularly clumsy or time consuming.  Have you simply tried navigating to Start -> Default Programs -> Set your default programs during previous attempts?  You highlight your browser of choice and click the Set this program as default link.  Typically, less than ten seconds.

Conversely, maybe our script gurus are aware of a method that I haven't heard of before, but that seems like a rather elaborate way of accomplishing a relatively simple task.  Just my 2¢-worth.
Avatar of AdminAssociates
AdminAssociates

ASKER

I am not particularly skilled or experienced at creating web pages, however I enjoy it and want to learn more.
The WYSIWYG program I am using to create web pages allows you to preview the current set in the default browser. To do so in a different browser requires me to save the changes, publish them, close the program, change the default browser, reopen the program, reload the current set and then preview the changes I just made, and by then I have probably encountered a senior moment and lost focus. If I could simply run a script or batch file, or something from the command line to change the default browser, it would be oh so much more simple.
Forgive me if I sound repetitive, but you didn't actually answer my question:  have you simply tried navigating to Start -> Default Programs -> Set your default programs during previous attempts?  My colleagues and I are prone to our own senior moments, but I must admit that I have never heard any of them describe that process as being overly time consuming.

Once again, I sincerely hope that one of the Experts Exchange script gurus has a method that I haven't utilize before to provide you with an ideal solution, but I'm not sure that it's quite that easy.
Why not open a copy of the web page in each browser, then after making changes refresh the page in each one to see how the page actually looks?

i.e. being set as the default browser should not affect how the page displays in it.
ASKER CERTIFIED SOLUTION
Avatar of Anuroopsundd
Anuroopsundd
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is what I had in mind. Thank you.
That solution should not work for win7, so why was the question posted in the windows 7 topic area?
e.g. it showed a registry file for Win98 (or WinME) and IE6.
Agreed.  We are always glad to help, but when we have devoted the time & effort towards helping you with your problem, it seems like it would simply be a professional courtesy to actually have our feedback questions answered.
I do apologize. I didn't mean to slight anyone. And, I realize the solution was not completely applicable but it got me started down the right road. I monitored the WIN7 registry changes made when changing defaults from IE9 to FF to Chrome and wrote my own reg files.  They seem to work just fine and require a single click to change default browsers.