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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:43:46+00:00 2026-05-14T19:43:46+00:00

I work on a application where i want to find out which files on

  • 0

I work on a application where i want to find out which files on my filesystem is used by a Process.

After trying around with the System.Diagnostics.Process class, and didn´t get the resulst i wanted i find the application called OpenedFileView from Nirsoft.

http://www.nirsoft.net/utils/opened_files_view.html

Basically it does exactly what i want but i have some problems with the implimication in my project.
The option wich “OpenedFileView” gives you is to start it with some arguments that it creates you an txt file with all the information i want.

But for my case i want to whach the processes in realtime, and if i start the application repetitively i always have the hourglass at my mouse cursor.

So after this i tryed some ways to get rid of it, tryed out to put it in a BackgroundWorker Thread. But this changed nothing at all. I also looked for a way to force the Process not to exit, and sending new arguments to it, but this also didn´t worked.

So is there any way to use this application in the way I want, or does this didn´t work at all?

I hope somebody can help me either with getting away this annoying mouse cursor hourglass, or with a better implimication of this application so i can use it in realtime!

Thanks alot!

private void start()
{
   _openedFileView = new Process();
   _openedFileView.StartInfo.FileName = "pathToApp\\OpenedFilesView.exe";
   _openedFileView.EnableRaisingEvents = true;
   _openedFileView.Exited += new EventHandler(myProcess_Exited);
   _openedFileView.StartInfo.Arguments = "/scomma pathToOutputFile";
   _openedFileView.Start();
}

private void myProcess_Exited(object sender, System.EventArgs e)
{
   start();
}
  • 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-14T19:43:47+00:00Added an answer on May 14, 2026 at 7:43 pm

    You’ll have to tweak your “real-time” requirement. A process can open and close hundreds of files in the time it takes to start that program. Given that you can never get a truly accurate view of file usage, you might as well reduce the rate at which you start the program. One immediate benefit is that you’ll greatly reduce the CPU load.

    A better mousetrap is the Sysinternals’ Handle utility. It’s a much lighter weight program. And is a console mode app, you can redirect its output so you don’t have to use a file. And there’s no wait cursor. It also allows selecting a specific process with the -p command line argument, an option you really want to use to keep execution time down to a reasonable level. This sample code worked pretty well:

    using System;
    using System.Diagnostics;
    
    namespace ConsoleApplication1 {
      class Program {
        static void Main(string[] args) {
          for (int ix = 0; ix < 100; ++ix) {
            var psi = new ProcessStartInfo(@"c:\bin\handle.exe", @"-p consoleapplication1");
            psi.UseShellExecute = false;
            psi.RedirectStandardOutput = true;
            var prc = Process.Start(psi);
            var txt = prc.StandardOutput.ReadToEnd();
            Console.WriteLine(txt);
            System.Threading.Thread.Sleep(1000);
          }
          Console.ReadLine();
        }
      }
    }
    

    Oh, and resist the temptation to use its “close file” option. That’s only good if you are looking for a way to permanently destroy data on your hard drive.

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

Sidebar

Related Questions

The company where I work created this application which is core to our business
I've a application that must work after another application. This second application has a
Weve recently been trying to work on an application that uses pandastream to encode
I have to present some 'process' or 'flow' of the application at work on
I have a c# console application which has some threads to do some work
I want to ask how can one write a software application which can automate
I work on an application that uses DCOM to communicate between what are essentially
I work on an application that has a both a GUI (graphical) and API
In an application I work on, any business logic error causes an exception to
I'm working on an application for work that is going to query our employee

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.