4 Replies Latest reply on Jul 9, 2012 12:28 AM by steve59

    How can I determine and extract the users default Browser file path?

    steve59

      Hi,

       

      Using Kevin Franks excellent free download ‘Application Window Controller 2.01’ It’s possible to re-position and size the Filemaker Application window similar to Microsoft OneNote ‘Dock to Desktop’ feature; 350px wide, far right on the desktop (tested and works fine for my needs on WinXP and Win7(64) in Filemaker Pro Advanced 12 and in FMP 12 Runtime).

       

      A feature of MS OneNote ‘Dock to Desktop’ mode is that all other windows including the users default Browser are width restricted and maximised top right alongside OneNote. This Allows the user to easily copy and paste information from web pages into OneNote – it would be cool to do the same directly into Filemaker fields – useful when web-scraping is not an option.

       

      My next goal (ideally from within Filemaker Pro) is to extract or calculate the client default web Browser file path, so that I can then script the repositioning of the users default browser application window left and alongside the Filemaker application window using Kevin Franks ‘WinControl’ utility.

       

      I note Filemaker Help says under ‘Open URL’ - “Note FileMaker Pro uses the preferences stored in the Windows system file URL.DLL to determine the application to handle the URL. The URL is then passed to ShellExecute for execution” I'm trying to figure-out how can I get the same info into a Filemaker script??

       

      I hope of interest to others and thank you for any pointers offered - Steve

        • 1. Re: How can I determine and extract the users default Browser file path?
          wimdecorte

          The default browser is stored in the registry:

          HKEY_CLASSES_ROOT\http\shell\open\command

           

          In tightly controlled environments this may be something that is set on the machine level instead of on the user level though so there probably is another in the HKLM hive for this.

           

          So you'll need OS-level scripting or a plugin that can read from the registry to find this out.

          1 of 1 people found this helpful
          • 2. Re: How can I determine and extract the users default Browser file path?
            steve59

            Wim,

             

            Thank you for the registry key info.

             

            OS level scripting reading from the registry at the user level sounds good as intended use will be per user on a personal machine.  So I’m not as concerned about ‘…tightly controlled environments’ beyond the permissions configured on a standalone machine.

             

            1st Question/idea:  Is it possible/realistic to read the registry  ‘HKEY_CLASSES_ROOT\http\shell\open\command’ using a ‘simple’ VB Script (?)  then maybe:

             

            1. Export the VB Script from Filemaker to a temp folder

            2. Use Filemakers ‘send event’ to run it from cmd.exe with wscript.exe

            3. Have the VB Script somehow output the result to a text file in the temp folder

            4. Import the result into Filemaker. And then delete the temporary files

             

            Steps 1, 2 and 4, I’m confident I can do.  I’ve little/no knowledge of VB Script – so found a few VB Scripts today on the web that do read the registry, but all were more than I needed and feel a high risk to edit. 

             

            2nd Question/Idea:  A lesser alternative perhaps is using Filemakers native file path Script steps; doing a folder search for all common browser.exc files; and presenting them for the user to select their default browser …even as I type this sounds more like a bad idea!?

             

            Ok enough from me!  Any feedback of good VB Script resources or ideas on another OS scripting approach recommended would be most helpful? 

             

            Steve

             

            PS.  Wim, Circa 2003 you posted a Filemaker.fp? of useful VB Scripts, not sure if it covered what I’m trying to do (?)  I likely still have it on a hard drive somewhere.

             

            Steve

            • 3. Re: How can I determine and extract the users default Browser file path?
              wimdecorte

              I don't have a windows machine close by.  The basics were probably covered in that VBscript inventory file.

              This link shows the basics, you still need to write the result out to a file though: http://stackoverflow.com/questions/1233651/how-to-check-for-registry-value-using-vbscript

               

              If all the machines are up to date you may want to do this in PowerShell instead, I think one could do it that way with one (long) command line which would make the deployment easier (no VBscript to export and clean up, just fire off the powershell command through a Send Event)

              • 4. Re: How can I determine and extract the users default Browser file path?
                steve59

                Cheers Wim for some great pointers; stackoverflow.com looks like a reliable resource and I shall now begin to pull info’ together and test the idea.

                 

                PowerShell sounds like a good option over VBscript “If all the machines are up to date…”!  My understanding is Windows XP SP3 will not install if PowerShell is present and that Microsoft Windows update does not reinstall PowerShell by default – offering it only as an ‘Optional Update’.  For that reason alone I shall begin with VBscript - assuming VBscript will work on any Windows machine of configuration unknown (?)

                 

                Another approach maybe! (?)  Microsoft OneNote’s ‘side note’ ‘Dock to Desktop’ feature is invoked as a locked application window; and any current of subsequent application windows are forced to maximise restricted alongside to the left.  If it were possible to achieve similar behaviour in the Filemaker Application Window – the same result could be achieved with an Open URL script step. I'd welcome any thoughts you may have on this theory?

                 

                Thank you for all your help; I’m excited about the possibilities discussed and the valuable links/ resources you’ve posted - Steve