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,855 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
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.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

730 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