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 6209887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:03:52+00:00 2026-05-24T06:03:52+00:00

My project is a plugin to a much larger project. A bug in the

  • 0

My project is a plugin to a much larger project. A bug in the larger project creates a file that will cause my application to crash. They are already aware of the issue and are addressing it, but in the meantime the only work around is to delete a certain file in the appdata directory for each user.

The plan is that during installation of the smaller plugin, to navigate to every user’s appdata directory to delete a problematic file (if it exists). Is there any way to find each User’s appdata directory. Remember this is an install, so we will have admin privileges. Some of the things I have seen is to use

WindowsIdentity.Impersonate(IntPtr someUser)
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

Then it would just be a matter of somehow getting the IntPtr, which I am unsure how to get.

That is the best solution I have right now. So how do I get the IntPtr of each user? Or is there a better solution?

The next best that I can think of would simply be to go through all directories of C:\Users\eachUser\AppData\ and deleting the file as it exists. But then again, in XP that location would have to be C:\Documents and Settings\eachUser\Application Data\ and I would be creating operating system specific code. Suggestions?

  • 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-24T06:03:52+00:00Added an answer on May 24, 2026 at 6:03 am

    From WindowsIdentity.Impersonate Method (IntPtr userToken):

    IntPtr userToken is…

    The handle of a Windows account token. This token is usually retrieved through a call to unmanaged code, such as a call to the Win32 API LogonUser function.

    So, you can’t do it this way unless you have all the usernames and passwords.

    Edit: Why not delete the file at runtime for just the current user? Does your plugin have permission to do this?

    Edit 2: You can use the installing user’s directory from Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), and then use Directory.GetDirectories to find the other users that have a profile. Then, you can tack on the special folder name. Pretty round-about, but it might work in your “pinch”.

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

Sidebar

Related Questions

Background: Our application is a plugin for a much larger application. Everything we create
Say I have the following file structure: app/ app.py controllers/ __init__.py project.py plugin.py If
I have findbugs plugin for eclipse which when run on my project will show
I'm building a project that uses the JVCL plugin system, which relies on runtime
Assume that the core project has a base entity and every plugin maybe extends
Most of the time finding missing file in project that has a central repository
I am working on a project that i want to have a plugin-sandbox like
I have a plugin project I've been developing for a few years where the
http://plugins.jquery.com/project/conmenu its a plugin for right click menu..... however it has no example usages
i registered 2 plugin in my project on zend framework the first one in

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.