The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,565 other followers

Some links on ShellNew: a user local place (registry and file system) to have Visual Studio templates for Blank Solution files

Posted by jpluimers on 2019/05/14

Some systems to not have a %windir%\ShellNew directory, so here are some links and observations on ShellNew entries in the registry.

Originally, I needed this for Creating a blank Visual Studio solution without a directory, and sln Format Version numbers but found a default installation did not have a %windir%\ShellNew directory.

A similar Windows 8.1 system had these files there:

  • EXCEL12.XLSX
  • MSPUB.PUB

On the Windows 10 system, these files were in C:\Program Files (x86)\Microsoft Office\root\vfs\Windows\SHELLNEW, so apparently, Windows 10 has moved more into a Virtual File System structure.

Machine wide registered extensions

The key HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew on both systems has the below values, indicating you do not need a file template: a binary template in the registry suffices:

  • Data having REG_BINARY content of a 22-byte empty .zip file
  • ItemName having a REG_EXPAND_SZ content pointing to @%SystemRoot%\system32\zipfldr.dll,-10194

The key HKEY_CLASSES_ROOT\.rtf\ShellNew on both systems has the below values, indicating you do not need a file template: a text template in the registry suffices:

  • Data having REG_SZ content of a 7 character file content {\rtf1}
  • ItemName having a REG_EXPAND_SZ content pointing to @%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE,-213

The key HKEY_CLASSES_ROOT\.bmp\ShellNew on both systems has the below values, indicating you do not need a file template: a zero byte template in the registry suffices:

  • NullFile having an empty REG_SZ
  • ItemName having a REG_EXPAND_SZ content pointing to @%systemroot%\system32\mspaint.exe,-59414

User wide registered extensions

At HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, is a value named Templates having an absolute path which can be expanded from %AppData%\Microsoft\Windows\Templates.

That directory was empty, but it is connected to the HKEY_CURRENT_USER\Software\Classes counterpart of HKEY_CLASSES_ROOT (the latter is an alias for HKEY_LOCAL_MACHINE\SOFTWARE\Classes).

So in stead of putting template files in %WinDir%\ShellNew plus registering them underHKEY_CLASSES_ROOT, you can put them in %AppData%\Microsoft\Windows\Templates and register them under HKEY_CURRENT_USER\Software\Classes.

Empty Visual Studio solution files for the current user

Since people have requested empty solution files to be created without creating a directory for a long time ([WayBack] create solution without folder – Visual Studio) and Visual Studio still does not allow you to do that, I have amended the %WinDir%\ShellNew based solution I created some 7 years ago at  Creating a blank Visual Studio solution without a directory, and sln Format Version numbers, to a current user based one:

[WayBack] jeroenp / wiert.me / commit / 01e4430712a6 — Bitbucket:

Amend empty Visual Studio templates to support%AppData%\Microsoft\Windows\Templates referenced from HKEY_CURRENT_USER\Software\Classes

Future

I might be able to morph this into a registry-only solution by using REG_MULTI_SZtyped values containing the actual .sln template content as multi-line strings separated by zero bytes. Some starting links on this for future reading:

Related

–jeroen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: