Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6654273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:22:14+00:00 2026-05-26T01:22:14+00:00

On my machine, it’s here: string downloadsPath = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), Downloads); But on a

  • 0

On my machine, it’s here:

string downloadsPath = Path.Combine(
   Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
   "Downloads");

But on a colleagues machine, this folder doesnt exist, and his Downloads folder is in his ‘My Documents’ folder. We are both on Windows 7*.

*Edit: in fact, it turns out he was not running the app on his own machine but a Windows Server 2003 machine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:22:14+00:00Added an answer on May 26, 2026 at 1:22 am

    Windows does not define a CSIDL for the Downloads folder and it is not available through the Environment.SpecialFolder enumeration.

    However, the new Vista Known Folder API does define it with the ID of FOLDERID_Downloads. Probably the easiest way to obtain the actual value is to P/invoke SHGetKnownFolderPath.

    public static class KnownFolder
    {
        public static readonly Guid Downloads = new Guid("374DE290-123F-4565-9164-39C4925E467B");
    }
    
    [DllImport("shell32.dll", CharSet=CharSet.Unicode)]
    static extern int SHGetKnownFolderPath([MarshalAs(UnmanagedType.LPStruct)] Guid rfid, uint dwFlags, IntPtr hToken, out string pszPath);
    
    static void Main(string[] args)
    {
        string downloads;
        SHGetKnownFolderPath(KnownFolder.Downloads, 0, IntPtr.Zero, out downloads);
        Console.WriteLine(downloads);
    }
    

    Note that the P/invoke given on pinvoke.net is incorrect since it fails to use Unicode character set. Also I have taken advantage of the fact that this API returns memory allocated by the COM allocator. The default marshalling of the P/invoke above is to free the returned memory with CoTaskMemFree which is perfect for our needs.

    Be careful that this is a Vista and up API and do not attempt to call it on XP/2003 or lower.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my machine, ctrl space is occupies by another program. How to chanhe this
I have in my machine a performance object that it not a default but
Machine does not have full sql server installed. but following distributable packages are installed
My new dev machine is lacking files in this location c:\program files (x86) \Microsoft
On my local machine, when I submit this form, and I do have items
On a client machine, I received this error. Can someone suggest me what can
On my development machine, I have JDK 1.7 installed, but we are packaging software
On my local dev machine this works perfectly: msbuild project.name.csproj /p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir=c:\proyectos\folder1\deploy /p:AutoParameterizationWebConfigConnectionStrings=false
My machine is little-endian (Intel byte order). I need to read a binary file
My machine apparently won't draw vertex lists in pyglet. The following code renders two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.