Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
1  
Great Question. –  Moab Mar 26 '11 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 '11 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 '11 at 1:21
add comment

1 Answer 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
    
share|improve this answer
    
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 '11 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. –  grawity Mar 30 '11 at 5:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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