Skip to main content

Environment SpecialFolder directory paths

The Environment.SpecialFolder enumeration can be used to obtain the full path to system special folders.
The enumeration includes:
Supported by the XNA Framework
ApplicationData
Common repository for application-specific data for the current roaming user.
CommonApplicationData
Common repository for application-specific data that is used by all users.
LocalApplicationData
Common repository for application-specific data that is used by the current, non-roaming user.
Cookies
Common repository for Internet cookies.
Desktop
The logical Desktop rather than the physical file system location.
DesktopDirectory
The directory used to physically store file objects on the desktop.
Favorites
Common repository for the user's favourite items.
History
Common repository for Internet history items.
InternetCache
Temporary Internet files folder.
Supported by the XNA Framework
Programs
The directory that contains the user's program groups.
MyComputer
The My Computer folder.
n.b.
The MyComputer constant always yields the empty string ("") because no path is defined for the My Computer folder.
MyMusic
The My Music folder.
MyPictures
The My Pictures folder.
Recent
The directory that contains the user's most recently used documents.
SendTo
The directory that contains the Send To menu items.
Supported by the XNA Framework
StartMenu
The directory that contains the Start menu items.
Supported by the XNA Framework
Startup
The directory that corresponds to the user's Startup program group.
System
The System directory.
Templates
The directory that serves as a common repository for document templates.
Supported by the
 XNA Framework
Personal
The directory that serves as a common repository for documents.
This member is equivalent to MyDocuments.
MyDocuments
The My Documents folder.
This member is equivalent to Personal.
ProgramFiles
The program files directory.
CommonProgramFiles
The directory for components that are shared across applications.
AdminTools
The file system directory that is used to store administrative tools for an individual user. The Microsoft Management Console (MMC) will save customized consoles to this directory, and it will roam with the user.
CDBurning
The file system directory that acts as a staging area for files waiting to be written to a CD.
CommonAdminTools
The file system directory that contains administrative tools for all users of the computer.
CommonDocuments
The file system directory that contains documents that are common to all users. This special folder is valid for Windows NT systems, Windows 95, and Windows 98 systems with Shfolder.dll installed.
CommonMusic
The file system directory that serves as a repository for music files common to all users.
CommonOemLinks
This value is recognized in Windows Vista for backward compatibility, but the special folder itself is no longer used.
CommonPictures
The file system directory that serves as a repository for image files common to all users.
CommonStartMenu
The file system directory that contains the programs and folders that appear on the Start menu for all users. This special folder is valid only for Windows NT systems.
CommonPrograms
A folder for components that are shared across applications. This special folder is valid only for Windows NT, Windows 2000, and Windows XP systems.
CommonStartup
The file system directory that contains the programs that appear in the Startup folder for all users. This special folder is valid only for Windows NT systems.
CommonDesktopDirectory
The file system directory that contains files and folders that appear on the desktop for all users. This special folder is valid only for Windows NT systems.
CommonTemplates
The file system directory that contains the templates that are available to all users. This special folder is valid only for Windows NT systems.
CommonVideos
The file system directory that serves as a repository for video files common to all users.
Fonts
A virtual folder that contains fonts.
MyVideos
The file system directory that serves as a repository for videos that belong to a user.
NetworkShortcuts
A file system directory that contains the link objects that may exist in the My Network Places virtual folder.
PrinterShortcuts
The file system directory that contains the link objects that can exist in the Printers virtual folder.
UserProfile
The user's profile folder. Applications should not create files or folders at this level; they should put their data under the locations referred to by ApplicationData.
CommonProgramFilesX86
The Program Files folder.
ProgramFilesX86
The Program Files folder.
Resources
The file system directory that contains resource data.
LocalizedResources
The file system directory that contains localized resource data.
SystemX86
The Windows System folder.
Windows
The Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables.
Full Microsoft resource: http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

Comments

[...] Environment SpecialFolder directory paths [...]

Popular posts from this blog

Ad hoc access to OLE DB provider has been denied

Using post SP2 SQL 7 (+ 2000 etc) attempting to access an OLEDB data source using OPENROWSET can produce the slightly spurious error: Ad hoc access to OLE DB provider 'MSDASQL' has been denied. You must access this provider through a linked server. In usual Microsoft style the message doesn't really mean what it says. From SQL 7 SP2 onwards MS by default blocked ad hoc query access with OLEDB. As the message suggests you could setup a linked server but that can be a real pain. Alternatively if you need ad hoc access server wide you could turn on ad hoc access for the SQL server you are using, explained in MS speak here: http://support.microsoft.com/default.aspx?kbid=266008 Ah, but it's not that simple. A little more witchcraft is required. The following registry settings can be used to enable ad hoc access: REGEDIT4 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Providers] "DisallowAdhocAccess"=dword:00000000 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLSer

Recover from corrupt SQL LDF transaction log file

Another favourite this month. A fault on one of our client's servers caused it to restart once every 10 minutes for 2 hours - the result was a corrupt LDF transaction log file for the main application database. It is surprisingly simple to recover from this situation: 1. Stop the SQL Server service 2. Copy the affected database (both LDF and MDF files) out of the main data folder. 3. Restart the SQL Server service 4. Create a new database of the same name and location as the database affected in step 2 - it is critical the filenames and paths are identical. 5. Stop the SQL Server service. 6. Copy the original MDF file (copied in step 2) in to replace the new MDF file created in step 4 7. Start the SQL Server service - the database will show as being suspect. 8. Now you need to recover the database, working from Query Analyser or SQL Management Studio: Use master go sp_configure 'allow updates', 1 reconfigure with override go select status from sysdatabases where name = '

Take website screenshot using ASP.NET

Utilising a hidden web browser control it is possible to take a screenshot of any website. The code shown below is based on an article at plentyofcode.com  (sorry the site now appears to be offline May 2012) but I have translated it from VB.NET to C# and will work in .NET so theoretically for any Windows or ASP.NET web project. using System; using System.Drawing; using System.Drawing.Imaging; using System.Windows.Forms; using System.Diagnostics; namespace WebsiteScreenshot { public class GetImage { private int s_Height; private int s_Width; private int f_Height; private int f_Width; private string myURL; public int ScreenHeight { get { return s_Height; } set { s_Height = value; } } public int ScreenWidth { get { return s_Width; } set { s_Width = value; } } public int ImageWidth { get { return f_Width; } set { f_Width = value; } } public int ImageHeight { get { return f_Height; } set { f_Height = value; } } public string Websit