0

I am looking to schedule (via Task Scheduler) a VBS script which changes my default web browser to Chrome silently (Windows 10, domain connected, with local admin privileges). At the moment, the control panel appears and then disappears. I'd like to make this task 'silent' so that no window pops up (end user should not notice the change occuring).

An extract of the VBS script at the moment (taken from How to automate setting Chrome as default browser Windows 10?)

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram\pageAdvancedSettings?pszAppName=google%20chrome"
WScript.Sleep 1200
WshShell.SendKeys "{TAB}"
WshShell.SendKeys " "
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys " "
WScript.Quit

Many thanks.

5
  • As you're interacting with the UI you probably won't be able to make it not show up using this method.
    – Seth
    Commented Jan 24, 2018 at 10:52
  • Thanks @Seth. Would you have any suggestions on an alternative method (not via the UI)? I know some suggestions relate to group policy however I'm hesitant to pursue those methods in a corporate environment.
    – Ellipsis
    Commented Jan 24, 2018 at 10:54
  • With these kind of changes, especially if you're trying to push that to multiple users, you are in a corporate environment, are you not? Looking for the appropriate registry key to change and using a reg file would be another option.
    – Seth
    Commented Jan 24, 2018 at 12:02
  • I am working within a corporate environment, however doing this 'on the sly' and not rolling out to multiple users. Unfortunately fighting a deployed package that changes the default to IE. I'll have a look at registry options, thank-you.
    – Ellipsis
    Commented Jan 24, 2018 at 15:20
  • Afaik microsoft prevents all programatic changes to default programs via their new "UserChoice" hashvalue. So you would have to do it via gui automation if you have no access to gpos. The only non gpo way is using "Dism.exe /online /Import-DefaultAppAssociations" but this will only affect newly created user profiles and not current ones iirc
    – Syberdoor
    Commented Jan 30, 2018 at 15:06

0

You must log in to answer this question.

Browse other questions tagged .