HOWTO: Make Scrivener projects look&work like files in Win7

I’ve long been annoyed by the mismatch between Windows’ file-orientation and Scrivener’s directory orientation… but only recently found a way to fix this. There are two tricks you can use to make Scrivener projects look more-or-less like ordinary Windows files, and open with a double-click just like regular files.

The first trick is just a wee bit of registry magic, that lets you double-click .scriv directories to open them in scrivener automatically (without having to dig down to find the project.scrivx):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\scriven]
@=“Open with Scrivener”
“DefaultAppliesTo”=“System.ItemName:~>”.scriv""
“AppliesTo”=“System.ItemName:~>”.scriv""

[HKEY_CLASSES_ROOT\Folder\shell\scriven\command]
@="“C:\Program Files (x86)\Scrivener\Scrivener.exe” “%1\project.scrivx”"

(Be sure to replace the path to Scrivener.exe as appropriate!)

This bit of magic basically says to windows, "if a folder name ends with ‘.scriv’, then add “Open with Scrivener” to the right-click menu, and make it the default option as well (which makes it double-clickable). This only works on Windows 7 (and presumably 8), but is quite worthwhile to add. (And hopefully, the L&L team will add it to future Scrivener installation packages!)

The second trick lets you replace .scriv folders’ icons with a Scrivener icon. Just create a desktop.ini inside a project, with these contents:

[.ShellClassInfo]
ConfirmFileOp = 0
IconFile=C:\Program Files (x86)\Scrivener\Scrivener.exe
InfoTip = Scrivener Project
IconIndex = 0

Again, replace your Scrivener.exe path as appropriate. Then, using “attrib +s folder.scriv”, flag the project folder as a system folder. Voila… the project will now have a Scrivener icon in place of a folder icon.

Unfortunately, you have to apply this trick to each project directory individually; it’s not a one-time fix like the registry entry is. So, this would be much more useful if added to Scrivener itself: just have saving a project add a desktop.ini to the folder and flag it as a system folder. (Better still, by adding a scrivener.ico file to the project directory, and using IconFile=scrivener.ico instead of a path to the executable, the directory will always appear as a scrivener project with appropriate icon, even when copied to other computers, viewed over a network, etc.)

If you want to know how I found out these crazy tricks, see:

“How to Customize Folders With Desktop.ini” - msdn.microsoft.com/en-us/library … 85%29.aspx

“Creating Shortcut Menu Handlers” - msdn.microsoft.com/en-us/library … 85%29.aspx (Scroll down to the section on “Getting Dynamic Behavior for Static Verbs by Using Advanced Query Syntax”), and

“Using Advanced Query Syntax Programmatically” - msdn.microsoft.com/en-us/library … 85%29.aspx

So, as you can see, these tricks are all Microsoft-documented and approved ways to work this sort of magic. (In fact, both tricks degrade gracefully on older Windows versions; the desktop.ini trick works on Vista, and both Vista and XP just add a “Open with Scrivener” right-click menu to all folders. Not great, but you can always skip the registry entries altogether on older Windows installations, or go the IContextMenu route for those versions.)

Thanks pje for the feedback. I did look at both these options a while back, and am aware that Skype or Dropbox use the icon trick for folders. At the time I was looking for a complete solution and was not satisfied with the compromises across versions and platforms. From memory, the other issue was that the registry changes you mentioned require administrator privileges; and I was aware that some users did not have admin access to their machines for whatever reason. I was also concerned that the registry update did not work on Vista or XP, and then there was Linux… Well this just all seemed rather ugly to attempt a fix when time was limited.

With all that said, I do agree entirely with the uglyness of Windows trying to emulate a Mac folder from a usability perspective, from a functional perspective I prefer it rather than having a single source of failure like a database as a single executable file - this would also introduce considerable complexity when exchanging project files from PC to Mac and vice versa as a lot of users do.

When the beta is over and the next release is out in a week or so time I will certainly revisit this issue and see if we can come up with a more comprehensive solution. In the interim, there is no issue with users implementing the suggestions you have made as they are perfectly valid and should not break anything we introduce down the track.

Once again, thanks for this feedback. I certainly appreciate folks thinking about usability issues like this.

Lee