Tuesday 2 October 2012

Windows tips

I like to consider myself reasonably competent in using Windows having picked up a whole bunch of tips, techniques and shortcuts over the many years (approximately 21) I’ve been using and programming against various versions of it.

For example, I’m one of a shrinking number of people who know that in a multi-selection list box with extended selection enabled (as opposed to a list view, just to be clear) you can press Shift+F8 to enter keyboard-driven multiple selection mode where Space toggles the selection of the current item and Shift+F8 or Esc leaves this selection mode. And I’ve know this since the days of Windows 3, before Raymond Chen made it more widely known in a 2006 post. Whilst on the subject of list boxes it’s also no longer well known that Ctrl+/ and Ctrl+\ perform select all items and select current item respectively.

However I’m always happy to pick up new tricks. I’ve bumped into a few recently and would like to share them with you.

Tip list:

Just before we get onto the “meat and potatoes” of this post I’ll randomly mention the Alt+Space and Alt+- shortcuts for dropping down the system menu on a top-level window and an MDI child window respectively. They used to be more obvious. The system menu is now represented (as of Windows 95) by the window icon at the left edge of the window’s caption bar.

In older versions of windows (such as Windows 3.x) the main window’s system menu was represented by a long bar and an MDI child system menu was represented by a shorter bar.

"Old school" system menu icons

It was common place before Windows XP for menus to try and make their keyboard shortcuts clear and obvious. You can see above that the File menu has F as its shortcut, thanks to it being underlined. As a Windows user this tells you that Alt+F drops down the menu. The two icons on the system menus were supposed to represent a space bar (on the main window) and a hyphen/dash (on the MDI child). This tells you that Alt+Space shows the main window system menu and Alt+- shows the MDI child system menu.

Anyway, enough of history. Let’s look at more contemporary stuff, much of which is new stuff revolving around Windows 8.

Shell shortcuts (Windows XP, Vista, 7, 8)

The first little shortcut (or collection of shortcuts) I bumped into a couple of weeks back dates back to at least Windows XP. I am quite staggered to have not happened upon them before.

They are all uses of the shell pseudo-command, which is understood by the Run dialog (WinKey+r) and by Windows Explorer (WinKey+e). I’m very much aware of support in the Run dialog and Windows Explorer, as well as at the Command Prompt, for environment variable expansion, which is a handy way of getting to certain paths and the shell pseudo-command offers a whole bunch of additional folder access shortcuts over and above what the pre-defined environment variables offer.

So let’s start with the environment variables. At a command prompt you can type SET and press Enter and see all the current environment variables. If you haven’t set any yourself then what you see will be the list of pre-defined environment variables. Some of the system directories or system-supplied user directories are represented by environment variables, such as windir (Windows folder), USERPROFILE (user’s home folder), TEMP (user’s temporary file folder), APPDATA (application data folder) and so on.

To open any of these directories in Windows Explorer you can type into the address bar the environment variable’s name surrounded by a pair of % signs and press Enter. The Run dialog also supports you typing something such as %USERPROFILE% and pressing Enter. All this environment variable expansion support comes from the command prompt (or DOS prompt as it was some years back). At a command prompt you can also use the same syntax, for example this changes the current directory to a user’s home directory:

cd %USERPROFILE%

The Powershell command processor doesn’t work in the same way. To use an environment variable to change directory in PowerShell you need something more like:

cd $env:APPDATA

Anyway, these were the only ‘special folder’ shortcuts I knew until I bumped into shell. The syntax for shell is to follow it by a colon and then by the special folder name, which is case-insensitive. There are lots of special folders supported and they are rather inconsistent in whether they have spaces or not, which ones use a plural and so on. But if you remember a few of them you’ll do yourself a favour from time to time.

Incidentally you can find where all these special shell folder names are defined by looking in the Windows registry at the path:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions

Each GUID subkey under that key defines a shell folder shortcut.

Windows XP (as far as I know) started support for this shell: command and each successive version adds more special supported folders. Windows 8 also removes some. The table below lists the ones I’ve found referenced – it should be quite straightforward to identify if any particular one is supported in earlier Windows versions – just try it :-).

Where the equivalent folder is listed this is either a physical folder on a drive or a virtual folder (such as in Control Panel). Where possible physical folders are listed in terms of the equivalent environment variable or shell: command. However some of these environment variables did not exist in Windows XP, for example LOCALAPPDATA and PUBLIC.

shell: command Description Location
shell:AddNewProgramsFolder Install a program from a network location on a managed Windows network Control Panel\All Control Panel Items\Get Programs
shell:Administrative Tools Administrative Tools subfolder from Start Menu\All Programs shell:Programs\Administrative Tools
shell:AppData Roaming Application Data folder from profile of logged-on user %APPDATA%
shell:AppUpdatesFolder Installed Updates, including those delivered by Windows Update and Microsoft Update Installed Updates
shell:Cache Internet Explorer Cache (aka Temporary Internet Files) %LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files
shell:CD Burning Burn folder, used to store temp files before burning to disc %LOCALAPPDATA%\Microsoft\Windows\Burn\Burn
shell:ChangeRemoveProgramsFolder Programs and Features folder Control Panel\All Control Panel Items\Programs and Features
shell:Common Administrative Tools same as shell:Administrative Tools shell:Common Programs\Administrative Tools
shell:Common AppData ProgramData folder, which holds global settings saved by applications %PROGRAMDATA%
shell:Common Desktop Public\Desktop folder %PUBLIC%\Desktop
shell:Common Documents Public\Documents folder %PUBLIC%\Documents
shell:CommonDownloads Public\Downloads folder %PUBLIC%\Downloads
shell:CommonMusic Public\Music folder %PUBLIC%\Music
shell:CommonPictures Public\Pictures folder %PUBLIC%\Pictures
shell:Common Programs Start Menu Programs for all users shell:Common Start Menu\Programs
shell:CommonRingtones Stores default ringtones for use with Windows ringtone editor using a compatible phone in Device Stage %PROGRAMDATA%\Microsoft\Windows\Ringtones
shell:Common Start Menu Start Menu folder, containing shortcuts and subfolders for all users %PROGRAMDATA%\Microsoft\Windows\Start Menu
shell:Common Startup Startup folder for all users %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup
shell:Common Templates Templates folder for all users; rarely used %PROGRAMDATA%\Microsoft\Windows\Templates
shell:CommonVideo Public\Videos folder %PUBLIC%\Videos
shell:ConflictFolder Sync Center\Conflicts Control Panel\All Control Panel Items\Sync Center\Conflicts
shell:ConnectionsFolder Network Connections Control Panel\All Control Panel Items\Network Connections
shell:Contacts Contacts folder from profile of logged-on user (deprecated) %USERPROFILE%\Contacts
shell:ControlPanelFolder Opens Control Panel and displays All Control Panel Items (icon view) Control Panel\All Control Panel Items
shell:Cookies Internet Explorer Cookies %APPDATA%\Microsoft\Windows\Cookies
shell:Cookies\Low Internet Explorer Cookies for sites with Low Integrity Level %APPDATA%\Microsoft\Windows\Cookies\Low
shell:CredentialManager Credentials folder %APPDATA%\Microsoft\Credentials
shell:CryptoKeys Crypto folder, stores machine keys %APPDATA%\Microsoft\Crypto
shell:Default Gadgets Default Windows Gadgets %ProgramFiles%\Windows Sidebar\Gadgets
shell:Desktop Desktop folder from profile of logged-on user %USERPROFILE%\Desktop
shell:Device Metadata Store DeviceMetadataStore folder, which contains digitally signed files, downloaded from Microsoft, with icons and custom settings for Device Stage items %PROGRAMDATA%\Microsoft\Windows\DeviceMetadataStore
shell:DocumentsLibrary Documents Library Libraries\Documents
shell:Downloads Downloads folder from profile of logged-on user %USERPROFILE%\Downloads
shell:DpapiKeys Protect folder, holds user keys for data encryption, including Encrypting File System %APPDATA%\Microsoft\Protect
shell:Favorites Internet Explorer Favorites folder from profile of logged-on user %USERPROFILE%\Favorites
shell:Fonts installed fonts and font families %windir%\Fonts
shell:Gadgets User-installed Windows Gadgets, including those that have been removed from the desktop but are still available %LOCALAPPDATA%\Microsoft\Windows Sidebar\Gadgets
shell:Games Games Explorer Games
shell:GameTasks Custom Games Explorer shortcuts for logged-on user %LOCALAPPDATA%\Microsoft\Windows\GameExplorer
shell:History Internet Explorer History %LOCALAPPDATA%\Microsoft\Windows\History
Shell:HomeGroupFolder Homegroup node in Windows Explorer Homegroup
shell:ImplicitAppShortcuts In User Pinned folder, contains shortcuts to system-managed Start Menu items, including Control Panel, Help and Support, and auto-published applications from Windows Virtual PC %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\ImplicitAppShortcuts
shell:InternetFolder Opens 32-bit Internet Explorer Same as running iexplore.exe
shell:Links Links folder from profile of logged-on user; contains shortcuts from Favorites node in Windows Explorer navigation pane %USERPROFILE%\Links
shell:Libraries Libraries node in Windows Explorer Libraries
shell:Local AppData Local Application Data folder from profile of logged-on user %LOCALAPPDATA%
shell:LocalAppDataLow Local Application Data (Low Integrity Level) folder from profile of logged-on user %USERPROFILE%\AppData\LocalLow
shell:MusicLibrary Music Library Libraries\Music
shell:My Music Music folder from profile of logged-on user %USERPROFILE%\Music
shell:My Pictures Pictures folder from profile of logged-on user %USERPROFILE%\Pictures
shell:My Video Videos folder from profile of logged-on user %USERPROFILE%\Videos
shell:MyComputerFolder Computer Folder Computer
shell:NetHood User-created network shortcuts %APPDATA%\Microsoft\Windows\Network Shortcuts
shell:NetworkPlacesFolder Network node in Windows Explorer Network
shell:Personal Documents folder from profile of logged-on user %USERPROFILE%\Documents
shell:PicturesLibrary Pictures Library Libraries\Pictures
shell:PrintersFolder Printers and Faxes All Control Panel Items\Printers
shell:PrintHood User-created printer shortcuts %APPDATA%\Microsoft\Windows\Printer Shortcuts
shell:Profile User Profile folder of logged-on user %USERPROFILE%
shell:ProgramFiles Program Files folder %ProgramFiles%
shell:ProgramFilesCommon Program Files\Common Files folder %CommonProgramFiles%
shell:ProgramFilesCommonX64 Program Files\Common Files %CommonProgramFiles% (in 64-bit Windows only)
shell:ProgramFilesCommonX86 Program Files (x86)\Common Files folder %CommonProgramFiles(x86)% (in 64-bit Windows only)
shell:ProgramFilesX64 64-bit Program Files folder %ProgramFiles% (in 64-bit Windows only)
shell:ProgramFilesX86 32-bit Program Files folder %ProgramFiles(x86)% (in 64-bit Windows only)
shell:Programs Start Menu\Programs folder from profile of logged-on user shell:Start Menu\Programs
shell:Public Public User Profile folder %PUBLIC%
shell:PublicGameTasks Custom Games Explorer shortcuts for all users %PROGRAMDATA%\Microsoft\Windows\GameExplorer
Shell:PublicLibraries Public User Libraries folder %PUBLIC%\Libraries
shell:Quick Launch Quick Launch folder from profile of logged-on user %APPDATA%\Microsoft\Internet Explorer\Quick Launch
shell:Recent Recent folder from profile of logged-on user %APPDATA%\Microsoft\Windows\Recent
shell:RecycleBinFolder Recycle Bin Recycle Bin
shell:ResourceDir Resources folder, which contains Windows themes, including Aero and ease-of-access themes %windir%\Resources
shell:Ringtones Ringtones folder stores custom files created by Windows ringtone editor using a compatible phone in Device Stage %PROGRAMDATA%\Microsoft\Windows\Ringtones
shell:SampleMusic Sample Music folder (by default in Public\Music folder) %PUBLIC%\Music\Sample Music
shell:SamplePictures Sample Pictures folder (by default in Public\Pictures folder) %PUBLIC%\Pictures\Sample Pictures
shell:SampleVideos Sample Videos folder (by default in Public\Videos folder) %PUBLIC%\Videos\Sample Videos
shell:SavedGames   %USERPROFILE%\Saved Games
shell:Searches Searches folder from profile of logged-on user; contains saved searches %USERPROFILE%\Searches
shell:SearchHomeFolder Opens Search Results window with focus in search box (same as pressing WinKey+F) search-ms:
shell:SendTo Send To folder from profile of logged-on user %APPDATA%\Microsoft\Windows\SendTo
shell:Start Menu Start Menu folder from profile of logged-on user %APPDATA%\Microsoft\Windows\Start Menu
shell:Startup Startup folder from profile of logged-on user %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
shell:SyncCenterFolder Sync Center, used mostly with Offline Files and Windows Mobile Device Center Control Panel\All Control Panel Items\Sync Center
shell:SyncResultsFolder Sync Center\Sync Results Control Panel\All Control Panel Items\Sync Center\Sync Results
shell:SyncSetupFolder Sync Center\Sync Setup Control Panel\All Control Panel Items\Sync Center\Sync Setup
shell:System Windows system folder %windir%\System32
shell:SystemCertificates Signed copies of digital certificates for system; use Certificate Manager to view details and add or remove certificates %APPDATA%\Microsoft\SystemCertificates
shell:SystemX86 32-bit Windows system folder %windir%\SysWOW64 (in 64-bit Windows only)
shell:Templates Templates folder from profile of logged-on user (rarely used) %APPDATA%\Microsoft\Windows\Templates
shell:User Pinned All shortcuts that have been pinned to the Taskbar and Start Menu by the currently logged-on user %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned
shell:UserProfiles Base user profiles folder C:\Users
shell:UsersFilesFolder Same as shell:profile %USERPROFILE%
shell:UsersLibrariesFolder same as shell:Libraries Libraries
shell:VideosLibrary Videos Library Libraries\Videos
shell:Windows Main Windows folder %windir%

Adding Quick Launch toolbar (Windows 7, 8)

Windows 7 and 8 (and maybe Vista – I didn’t pay enough attention) have removed the Quick Launch toolbar from the task bar. If you miss it you can add it back in. Right-click on the task bar, choose Toolbars and then New toolbar… From here you can pick any folder whose content will the toolbar items.

However it should be made clear that these toolbars aren’t toolbars in the normal sense of the word. Instead a task bar toolbar is an item on the task bar that, when clicked, pops up a set of menu items, one for each file or folder in the chosen toolbar folder.

Quick Launch toolbar

To add the Quick Launch toolbar back you need to locate the Quick Launch folder and add that. From the table above you can see that entering shell:Quick Launch into the folder selection dialog will do the trick. That shell: command is much briefer than the closest equivalent environment variable version of %APPDATA%\Microsoft\Internet Explorer\Quick Launch so makes a good case for knowing some shell: commands.

“God” mode (Windows 7, 8)

A couple of years back there was a lot of noise about a way of initiating so-called “God” mode on Windows. This involves creating a folder and naming it with a mysterious looking name, after which the folder turns into Pandora’s box called the All Tasks folder, which contains shortcuts to a large number of administrative functions, the sort that are normally located in various parts of the Control Panel applets.

The idea is to create a folder and name it:

<anything>.{ED7BA470-8E54-465E-825C-99712043E01C}

The initial coverage used:

GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

which may well explain the description for this feature. Once the folder has been given an appropriate name the extension disappears, the icon changes to the Control Panel icon and all the content is available. Here is a “God” mode folder opened up on Windows 8.

"God" Mode

According to Brandon Paddock this behaviour is an example of turning a file system folder into a namespace junction. Ed Bott also points out that the large list of functions is an unfiltered view on all the options available in Control Panel and he shows how you can locate any of them by searching in Control Panel or in the Windows 7 Start Menu or Windows 8 Settings Search.

Add any application as a Start screen tile (Windows 8)

When you install software on Windows 8 only some applications get pinned to the Start screen. Anything that is added to what used to be a Start menu group can still be found in the All Apps screen. But sometimes you want to add some arbitrary app to the Start screen, such as an executable that is not in a Start menu group – maybe a little utility you’ve copied onto your hard drive.

To do this you open Windows Explorer and navigate to:

%APPDATA%\Microsoft\Windows\Start Menu\Programs

However this can be shortened using shell: commands to:

shell:Start Menu\Programs

and shortened further to:

shell:Programs

In this folder you add a shortcut to the application in question. This causes the app to show up in the All Apps screen on Windows 8 in the first (ungrouped) chunk of app tiles. Either locate the app in the All Apps screen or start typing its name on the Start screen to locate it. Now right-click on it (or select it using arrow keys and press Shift+F10) and choose Pin to Start.

Toggle Windows Explorer ribbon (Windows 8)

Windows 8 replaces the Windows Explorer menu with a ribbon. But the ribbon is rather larger than the menu. If you want more screen space occasionally you can toggle the ribbon’s visibility with Ctrl+F1.

Option to exit Windows Explorer (Windows 8)

Sometimes developers need to kill off the Windows shell (in other words Windows Explorer) and restart it. Windows 8 makes this a little easier by offering a menu option to kill the current Explorer shell, albeit a hidden menu option.

To see the menu option Ctrl+Shift+right-click on the task bar and the item Exit Explorer will appear at the bottom of the context menu. Killing off the shell instance of Explorer removes the desktop and the task bar, so you’ll need to use Task Manager to start a new instance (File, Run new task in Windows 8).

An alternative to using the hidden menu item is to simply locate Windows Explorer in the updated Task Manager (you’ll find it in the Windows processes section), right-click on it and choose Restart.

Desktop shortcut to all apps (Windows 8)

The Start screen is like the initial view on the Start menu in Windows Vista and Windows 7 and the All Apps screen is much like what you get when you click Programs on the Windows 7 Start menu. For those who spend most of their time working with desktop apps the All Apps screen is a common screen to go to.

There are various ways to get to the All Apps screen from the Windows desktop, including:

  • press WinKey to go to the Start screen then press Ctrl+Tab
  • press WinKey to go to the Start screen, then WinKey+z to bring up the app bar and Enter to select the All apps option
  • press WinKey+q to start searching through apps on the All apps screen
  • press WinKey+r to bring up the Run dialog and type this command followed by Enter:
    shell:::{2559a1f8-21d7-11d4-bdaf-00c04f60b9f0}

You can also put a shortcut to the All apps screen on your Windows desktop. Use this command line for the location of the item when creating the shortcut:

explorer shell:::{2559a1f8-21d7-11d4-bdaf-00c04f60b9f0}

Now you can pin this to the task bar by using the appropriate context menu item.

If you drag this over to the left side of the task bar and maybe choose a different icon, you aren’t far from having something a bit like the Windows 7 Start menu’s Programs menu available to use in Windows 8. Interestingly there is an icon that looks just like the old Start menu in explorer.exe – the second one on the second row.

Start menu icon

You can also set up an additional custom shortcut key if you don’t much like WinKey+q.

As well as your new first task bar icon going to the All Apps screen, you also have the shortcut for going to the Start screen which is accessed by moving the mouse to the bottom left of the screen.

Another option for accessing the programs, which may have a bit of retro appeal is to add 2 new toolbars to the task bar (see above) for these two folders:

  • shell:Programs
  • shell:Common Programs

The old Start menu’s programs list is a merging of the user’s programs and the programs set up for All Users

More on the Quick Link menu (Windows 8)

The Quick Link menu (WinKey+x) will be useful for technical types as it has direct shortcuts to a number of useful system features and options pages.

You may at some point wonder if the list of menu items is customisable. The grouped sections of menu items are all defined by shortcuts in folders within %LOCALAPPDATA%\Microsoft\Windows\WinX.

You can delete any unwanted menu items by deleting their corresponding shortcuts. You can also regroup them by shifting them around the subfolders. Additionally you can change the shortcut names by editing the hidden desktop.ini files in the group subfolders and change what the shortcuts do by editing their properties (just like any other shortcuts).

To add new items on the Quick Link menu takes more than just adding a new shortcut in one of the group subfolders. Presumably in order to prevent software installers taking over the Quick Link menu and swamping it in unnecessary extra items any shortcut must have a special hash mark applied to it.

To add a hash mark to a shortcut link you can use Rafael Rivera’s hashlnk tool, whose use is illustrated on howtogeek.com. hashlnk is a command-line tool, so a little fiddly. Another option is a GUI Win+X Menu Editor that can customise the menu, whose use is illustrated in this post.

2 comments:

  1. Thank you, this is huge and great information. Bookmarked your site. Are you MVP?

    ReplyDelete
    Replies
    1. Hey, glad you found it useful - I sure do !
      No, I'm not an MS MVP. I'm an Embarcadero MVP though :o)

      Delete