1

I would like to change a file association in Windows 7. I want to set the file to open with Google Chrome, however I want to pass through the -incognito flag to the exe so it defaults to incognito mode.

When I try to pass through the path to chrome C:\Users\jon3laze\AppData\Local\Google\Chrome\Application\chrome.exe -incognito I get a File not found error.

I also tried creating a shortcut to the chrome.exe and setting the path to use incognito. This works if I execute the shortcut directly, however when I point the file association to the shortcut it still opens the file in an already opened (not incognito) chrome window.

How can I go about forcing a file association to use GC incognito?

Update


I tried changing the file association using assoc I found the information here It also did not work. I think the issue is that, if chrome is already open. It will default to the already open chrome rather than open in incognito. I would like to set specific file types such as .jpg or .pdf for this.

The file types now correctly have the --incognito flag associated to them, however don't open in an incognito window...even if all chrome windows are closed.

I tried duplicating the chrome.exe, renaming it and having the shortcut point to that with the flags instead. It seems the file properties showing that the original file is chrome.exe makes it continue to associate the files to the original.

3
  • 1
    Great Question.
    – Moab
    Mar 26, 2011 at 3:20
  • Try adding a ​  --  ​ between the command-line args and the filename; that’s the command-line with which Chrome registers filetypes (though on my own system, I’ve left it out without issue).
    – Synetech
    Mar 26, 2011 at 14:08
  • I still run into the same issue. The file opens up in an already open, non incognito, window instead of opening a new incognito window.
    – jon3laze
    Mar 30, 2011 at 1:21

2 Answers 2

1
  1. Open regedit.
  2. Navigate to HKEY_CURRENT_USER\Software\Classes.
  3. Under Classes, open the .html key (folder) and note what the "(Default)" value is set to. Most likely it'll be ChromeHTML.
  4. Go back to Classes and open the key you noted in #2.
  5. Open the shell\open\command subkey.

    (At this step you should be at HKEY_CURRENT_USER\Software\Classes\ChromeHTML\shell\open\command.)

  6. Double-click the (Default) value and change its data to

    "C:\Users\jon3laze\AppData\Local\Google\Chrome\Application\chrome.exe" --incognito -- %1
    
2
  • How would you go about doing this for different file types other than .html? For example, if I wanted .pdf or .jpg to default to incognito but everything else to use normal mode?
    – jon3laze
    Mar 30, 2011 at 1:25
  • @jon3laze: If you have .pdf and .jpg associated with Chrome (unusual, I might say), follow steps 1-6. But you cannot set such rules for any random address you browse on the internets; this is only about what process is launched upon double-clicking a file on Windows Explorer.
    – user1686
    Mar 30, 2011 at 5:37
0

NirSoft's File Types Manager is a very convenient way to edit file type associations with flags/parameters, without having to lurk through lots of subfolders in the registry.

I tried setting a .pdf incognito association as you were trying to do, and it worked no problem.

You can do other things as well, such as quickly add or remove right click context menu items (i.e. "Edit in Notepad++"). Whenever you need to manage something clunky in Windows, I recommend always checking NirSoft first. They have a huge amount of useful utility programs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.