[OFF] CHKDSK Windows 10


We have a constant problem with our customers with the HD.

From time to time the PC go slow because the HD.
It is solved by CHKDSK .

Some of our customers don’t know how to do it.

Is there any way to do it from 4D v17R4 with Launch External Process (As administrator) ?

It is possible to do it also with Launch External Process in Mac Os 10 ?


I assume Microsoft tech support would say: better fix the error, then trying to workaround.

The disk only goes bad if there is a hardware error - or if the computer is often losing power, not correctly shut down. You might also lose data doing so.
Better to check the computer and teach the customer.

Hi Thomas,

Probably you usually work with Mac OS.
You will be surprise how much change the speed in windows after 2 or 3 months of PC used by normal users, for individual and little bussines (1 to 4 users each). They assume that the computer take more than 3 minutes starting. Or they don’t know, because they don’t stop ever the computer (hotels)

We have tried to teach them. But most clients are dangerous to do it, or they have no interest.
In the end, they think that the application is slow and it is not a hardware problem. Since other applications such as Firefox, LibreOfice, … they work well.

We develop standard vertical application. Of course, we recommend rules for the correct use and also backup and UPS, …
Just for they will not need to call us (which is a cost) and they don’t think our system is slow.

Despite our suggestions, they work without especial care. For example:

  • Restarting the computer because a Energy cut.
  • Restarting the computer without exiting applications.
  • Restarting the computer without stoping system, …

So the disks get many little errors that Windows doesn’t fix without running the CHKDSK.

Example: I saw many times the 4D Client connecting to 4D Server takes more then 1 minute, reading resources, … , each time I connect to it. Even I haven’t change anything on server.
Then I run the CHKDSK and it takes 1 or 2 seconds without reading resources, … .
I supoosed that cache and others things written on disk has problem, …

So. My experience says that users don’t change the way they work. It could be fine if I can solve it by my own. Without having expectations irreales.
They will have good experiences with our progrmas and will recommend to others.

: Alfonso ZAFON
  • Restarting the computer without exiting applications.
  • Restarting the computer without stoping system, …
    So the disks get many little errors that Windows doesn’t fix without
    running the CHKDSK.

This should not be any issue. Even if the user just press the power button on the computer, this is supposed to shut down the computer, and this will shutdown 4D.

Modern (younger than 10 years) computer have a power button this is just a click button. It does not kill power, it tell the OS to shut down.

And OS calls the applications.

How does your application behave? Is it able to quit itself in less than a second?
If not, you have a coding error!
Try that. Try it as long, till you reach a quick time from a second.

Use Process aborted in any loop. Don’t discuss, if that flag become true, stop whatever you are doing and stop any loop. Cancel anything.
Don’t use an On Exit with interprocess variables to tell loops to stop, that’s the wrong way. Use Process aborted.
Don’t ask questions. (you might open a dialog are you sure if the users uses the Quit menu, but not when the system does a fast shut down).
Some people try to get longer time to quit, there is a plugin allowing that:

But some end users don’t wait, if an application takes too long, they use task manager to kill the app. Only solution: quit in less than a second.

If your application will not be able to quit fast, you might have unsaved data in the local cache files, but this is a “bug” in your code, you are not following system rules.


As I supposed, you are not familiar with small businesses, at least in Spain. The equipment can be more than 5 years old, and of course NO SSD.
If you keep the shutdown button pressed for more than 2 seconds, the device shuts down without further ado (and they know it!).

Yes, our applications turn off quickly, that’s not the problem.
Although, of course, there may be some error that causes its forced closure. Well for our code, either because of the interaction with other programs or because the system is blocked.

In the end, the problem is that disk damage is generated and, at least Windows, does not solve it without CHKDSK.

There is a bug that is stil not corrected

139767 : QUITTER 4D et Methode projet Sur fermeture [ACI0098658]

Even in good conditions 4D don’t act as it should… :cry:


Anyone knows if it’s possible to do it ?
Or, is there a way to do what I need ?