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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:05:52+00:00 2026-06-18T16:05:52+00:00

I have a viewer.exe that loads at startup some models ( *.mdl ) from

  • 0

I have a viewer.exe that loads at startup some models (*.mdl) from a “models” folder. Some of the models crash viewer.exe: “viewer.exe has stopped working. Windows can check online for a solution to the problem”.
What I could do is move all the .mdl files in a “source” folder and then manually test for each .mdl file moved to “models” if viewer.exe is running but, there are a lot of files to check. How do I move each *.mdl file from “source” to “models” and test programmatically if viewer.exe is running correctly?

Here is the code I use for my first problem: to move the .mdl files from “source” folder sub-directories in “models”. Some of the files had identical names but different size:

String mask = "*.mdl";
String source = @"c:\Source\";
String destination = @"c:\Models\";

String[] files = Directory.GetFiles(source, mask, SearchOption.AllDirectories);
foreach (String file in files)
{
    if (File.Exists(file) && !File.Exists(destination + new FileInfo(file).Name))
    {
        File.Move(file, destination + new FileInfo(file).Name);
    }
    else
    {
        FileInfo f = new FileInfo(file);
        long s = f.Length;
        FileInfo f2 = new FileInfo(destination + new FileInfo(file).Name);
        long s2 = f2.Length;
        if (s >= s2)
        {
            File.Delete(destination + new FileInfo(file).Name);
            File.Move(file, destination + new FileInfo(file).Name);
        }
    }
}
  • 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-06-18T16:05:53+00:00Added an answer on June 18, 2026 at 4:05 pm

    use process.start(startInfo) (see http://msdn.microsoft.com/en-gb/library/0w4h05yb.aspx)

    Wait a few seconds, check if the process has terminated, then the returned process.hasexited (http://msdn.microsoft.com/en-us/library/system.diagnostics.process.hasexited.aspx)

    then kill it anyway using process.kill() (see http://msdn.microsoft.com/en-us/library/system.diagnostics.process.kill.aspx)

    You might need to turn off windows error reporting: http://msdn.microsoft.com/en-us/library/bb513638(VS.85).aspx

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

Sidebar

Related Questions

I installed a Windows serivce that fetches has to fetch some strings from the
I have a scroll viewer in my application that contains a canvas, in which
I have used DLL Export viewer to try and find the functions that are
I have noticed that when you view PDFs in google docs the PDF viewer
I have idea to write errors from my application to the Windows Event Viewer
I'm working on a project that has a proprietary file format. The project has
i have just downloaded the latest win32 jpegtran.exe from http://jpegclub.org/jpegtran/ and observed the following:
I've been working on a simple project that uses some common .NET classes, isolated
I have some unit tests set up in my PowerBuilder application that run through
I have a .NET COM DLL that I want to unregister. I do: regasm.exe

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.