Solved

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

Posted on 2012-04-07
11
2,783 Views
Last Modified: 2012-04-08
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.
0
Comment
Question by:AdminAssociates
  • 3
  • 3
  • 2
  • +1
11 Comments
 
LVL 28

Expert Comment

by:Run5k
ID: 37820277
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.
0
 

Author Comment

by:AdminAssociates
ID: 37820329
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.
0
 
LVL 28

Expert Comment

by:Run5k
ID: 37820334
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.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 44

Expert Comment

by:Darr247
ID: 37820387
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.
0
 
LVL 17

Accepted Solution

by:
Anuroopsundd earned 500 total points
ID: 37820815
0
 

Author Closing Comment

by:AdminAssociates
ID: 37821121
This is what I had in mind. Thank you.
0
 
LVL 44

Expert Comment

by:Darr247
ID: 37821270
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.
0
 
LVL 28

Expert Comment

by:Run5k
ID: 37821666
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.
0
 

Author Comment

by:AdminAssociates
ID: 37821812
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.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question