Search code examples
filegoogle-chromesettingsinternal

Use Chrome portable to open a index.html file on the same USB stick for a homepage


IS it at all possible to set the Google homepage to a file located on my USB pen drive?

I can link it though the file path, problem being the drive letter would change depending on the system it is plugged into so a hard coded homepage link wont work.

Im unsure of the syntax to use to make it upen the file -

%USBDRIVE%/Webfiles/index.html

The page is used to help new users navigate the USB pen and get the info/files they require as its aimed as users with next to no IT skills or disabilities

Thanks Guys


Solution

  • You've probably found a solution already, but just come across your question and I recently had the same scenario. I'm assuming you mean on PC.

    I solved it as follows:

    In the PortableGoogleChrome folder (after portable chrome is setup on the usb drive), there is a default file called parameter.txt. I added the following in order to set the homepage to my local file. It is in a sub folder called 'resources' located on the usb drive root:

    --homepage="\resources\index.html"
    

    That's all for the parameter.txt file. That takes care of the homepage setting.

    Now to launch portable chrome, I created a windows batch file called launcher.bat also at the root of the usb drive (call it whatever you like obviously!). I added the following code:

    @echo off
    cd PortableGoogleChrome
    "ChromeLoader.exe"
    

    The launcher file changes the directory to PortableGoogleChrome and then loads Chrome via ChromeLoader.exe which takes in your homepage or other parameters in Parameters.txt.

    FINALLY, in order to create an application to replace the Launcher.bat file (as I figured a windows application with icon would be more intuitive to run than the batch file), I found a windows utility called bat_to_exe_converter which enabled me to convert the bat to an exe and supply an icon also (having tried to do so in C++, C# but errors because of needing supporting DLL's, this was much more straightforward).

    Hope that's of use!