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

  • SEARCH
  • Home
  • 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 6669379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:08:34+00:00 2026-05-26T03:08:34+00:00

I am using C# to access the most recent files on a system and

  • 0

I am using C# to access the most recent files on a system and copy them via

Environment.SpecialFolder.Recent

The recent folder in Windows however just creates shortcuts to the actual location of the file. How would one go about copying the file that the shortcut is pointing at as opposed to the shortcut itself?

Many Thanks in advance for any help

  • 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-26T03:08:35+00:00Added an answer on May 26, 2026 at 3:08 am

    I found and altered this code, works for me:

    static string GetShortcutTargetFile(string shortcutFilename)
    {
        string pathOnly = System.IO.Path.GetDirectoryName(shortcutFilename);
        string filenameOnly = System.IO.Path.GetFileName(shortcutFilename);
    
        Shell32.Shell shell = new Shell32.Shell();
        Shell32.Folder folder = shell.NameSpace(pathOnly);
        Shell32.FolderItem folderItem = folder.ParseName(filenameOnly);
        if (folderItem != null)
        {
            return ((Shell32.ShellLinkObject)folderItem.GetLink).Path;
        }
    
        return ""; // not found, use if (File.Exists()) in the calling code
        // or remove the return and throw an exception here if you like
    }
    

    You have to add a reference to the Microsoft Shell Controls And Automation COM object (Shell32.dll) to the project to make this work.

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

Sidebar

Related Questions

I'm using Access 2003 on a duo-core machine with 4GB of RAM, running Windows
I am trying to access a dll located in the c:/Program Files (x86) folder
Using Access 2003 In my table column, some of the fields are null, some
Using Access 2003 I want to get a table value from the two databases
Using Access 2003 Database Table1 Intime Outtime WorkTime OverTime 08:00:00 19:00:00 09:00:00 02:00:00 09:00:00
Using Access 2003 Table1 ID Name Value 001 Raja 100 002 Ramu 200 004
Using Access 2003 Date Column datatype is text Table1 Date 20090528 20090529 20090530 20090502
Using Access Database Table ID Time 001 100000 001 100005 001 103000 001 102500
We have an ADP project created several years ago using Access 2000. This project
I have the following problem in a Database using Access 2007 as front end

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.