Start Chrome in incognito mode

Maybe you don't want a bunch of cached data hanging around after your browser session exits. Maybe you travel a lot with your laptop and don't want a bunch of private information on a machine that might be stolen. Maybe you do a lot of "birthday shopping."

Whatever the reason, if you prefer to use Chrome in incognito mode for most of your day to day browsing, Michael T. Bee sent us a convenient script that starts up Chrome in incognito mode automatically. Here it is in all it's glory:

//Chrome_Incognito.js - start new chrome incognito(sort of)


var liWait=175; //wait ms (double on older pc)

var oSh=new ActiveXObject("WScript.Shell");
oSh.Run("chrome.exe"); //start chrome
WScript.Sleep(liWait);
oSh.Sendkeys("^+N"); //start new incognito window
WScript.Sleep(liWait);
oSh.Sendkeys("%{Tab}"); //go previous(first) browser window
WScript.Sleep(liWait);
oSh.Sendkeys("%{F4}"); //close first browser window

Just drop this in notepad and save it as chrome_incognito.js on your desktop. When you double click it, it will launch Chrome, make an incognito window, and then close the first window. It does all this by sending artificial keypress events to the application through the Shell ActiveX object, a technique which might come in handy for scripting other standard Windows applications.

If you have an older or slower machine, you might need to adjust the liWait variable to give your machine time to launch Chrome before the application starts sending fake keypresses to it.

Going Incognito At Startup


Recent Entries

Comments

Oldest comments listed first.

Posted by: rio on October 27, 2008 at 5:10 PM

Thanks! I was searching for this trick for a while! Anyway, if you want the incognito window to be maximized, replace the line:
oSh.Run("chrome.exe"); //start chrome

with:
oSh.Run("chrome.exe -start-maximized"); //start chrome

nJoy!


Posted by: Dylan on November 2, 2008 at 8:57 PM

simply append --incognito to the file path, and Chrome will start in incognito mode. you can make this adjustment in the file properties very easily.


Posted by: howiem on November 3, 2008 at 6:45 AM

SXaving the script to the desktop got me a script error (WSH error). However, when I moved the script file to the Chrome application folder, created a shortcut and put the shortcut on the desktop, it worked.
Agree that the command line entry in properties is easier, but some people don't always want to run incognito.
Does anyone know how to tell from within Chrome that it is in fact running incognito?


Posted by: howiem on November 3, 2008 at 6:46 AM

SXaving the script to the desktop got me a script error (WSH error). However, when I moved the script file to the Chrome application folder, created a shortcut and put the shortcut on the desktop, it worked.
Agree that the command line entry in properties is easier, but some people don't always want to run incognito.
Does anyone know how to tell from within Chrome that it is in fact running incognito?


Posted by: howiem on November 3, 2008 at 6:47 AM

SXaving the script to the desktop got me a script error (WSH error). However, when I moved the script file to the Chrome application folder, created a shortcut and put the shortcut on the desktop, it worked.
Agree that the command line entry in properties is easier, but some people don't always want to run incognito.
Does anyone know how to tell from within Chrome that it is in fact running incognito?


Posted by: magicm00 on November 6, 2008 at 7:39 PM

howiem, wouldn't it be easier to just put a shortcut on the desktop with the "--incognito" switch enabled, instead of linking to the script which just does the same thing?

You can tell that a Chrome window is in incognito mode from the incognito symbol in the upper left corner. You know, the one with the hat and the trenchcoat.


Posted by: Anonymous on November 27, 2008 at 10:06 PM

Doesn't work.


Posted by: Anonymous on January 11, 2009 at 11:31 AM

right click on nothing, choose new->shortcut. When it asks you what to link to, browse for chrome.exe. after it has filled in "c:/blahblahblah/chrome.exe", add " -incognito" to the END. when its done, it should look like:
"C:/blah-blah-blah-directory-of-chrome/chrome.exe" -incognito
test it, it should automatically open an incognito window.


Leave a comment


Subscribe to MAKE!Subscribe to MAKE Magazine!

Subscribe today, save 42% and get web access to MAKE free. MAKE Digital Edition is available only to subscribers.

$34.95 / 1 year
(4 Quarterly Issues)

Subscribe now


Void your warranty, violate a user agreement, fry a circuit, blow a fuse, poke an eye out. Make: The risk-takers, the doers, the makers of things... Welcome to Make: Online!


CRAFT Maker Shed Maker Faire MAKE television




Check out more videos from MAKE.

MZ_Jameco-RobotBuild_RR.gif
MZ_DIYMovieMaking-RR.gif
Maker SHED

Connect with MAKE

Be a MAKE fan on Facebook MAKE on Facebook
Visit our Facebook page and become a fan of MAKE!
MAKE on Twitter MAKE on Twitter
Follow our MAKE tweets!
MAKE Flickr Pool MAKE on Flickr
Join our MAKE Flickr Pool!
    make_tips on Twitter



    MAKE Archives

    Make: Money

    Make: Science Room
    Subscribe to MAKE Magazine!

    Make: Online editors and authors!

    Gareth BranwynGareth Branwyn
    Editor-in-Chief


    Phillip TorronePhillip Torrone
    Senior Editor
    | Web | Twitter


    Becky SternBecky Stern
    Associate Editor
    | AIM | Twitter


    Marc de VinckMarc de Vinck
    Contributing Writer
    | AIM | Twitter


    John ParkJohn Park
    Contributing Writer
    | Twitter


    Sean RaganSean Ragan
    Contributing Writer
    | Twitter


    Matt MetsMatt Mets
    Contributing Writer
    | AIM | Twitter


    Dale DoughertyDale Dougherty
    Editor & Publisher
    | Twitter


    Shawn ConnallyShawn Connally
    Managing Editor
    | Twitter


    Goli MohammadiGoli Mohammadi
    Associate Managing Editor

    Kip KayKip Kay
    Weekend Projects
    | AIM | Twitter


    Collin CunninghamCollin Cunningham
    Contributing Writer
    | AIM | Twitter

    Adam FlahertyAdam Flaherty
    Contributing Writer
    | AIM | Twitter


    John BaichtalJohn Baichtal
    Contributing Writer
    | AIM | Twitter



    More contributors: Mark Frauenfelder (Editor-in-Chief, MAKE magazine), Kipp Bradford (Technical Consultant/Writer), Chris Connors (Education), Diana Eng (Guest Author), Peter Horvath (Intern), Brian Jepson (O'Reilly Media), Robert Bruce Thompson (Science Room)

    Suggest a Site!

    Advertise here with FM.

    Why advertise on MAKE?
    Read what folks are saying about us!

    Click here to advertise on MAKE!



    Current Podcast

    itunesdl.gif Weekend Project: Pinhole Panoramic Camera A sturdy, panoramic design pinhole camera that uses 120 film. Thanks go to Ross Orr for the original article in MAKE Volume 09. To download The Pinhole Panoramic Camera video video click here and subscribe in iTunes. Check out... More...

    Get the Make: Online sent via email
    Enter your email to receive Make: Online each day:



    Sign up for the Make: Newsletter

    Our Make: Newsletter covers news from maker Media, has original columns, Shed deals, and more! You can also read the archives of past issues.


     



    MAKE Fascination video series brought to you by Dow

    Make: Education
    MAKE: en EspaƱol MAKE: Japan
    Important please read


    Subscribe to MAKE Magazine!

    Recent Posts from the Craft: Blog