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,692 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now