D
D
dronreviews2015-03-23 20:14:23
Programming
dronreviews, 2015-03-23 20:14:23

How to call the standard Windows "defrag" program in C/C++ code?

Hello.
Can't call defrag program and pass keys when writing C++ code

system("defrag");
  или
 system("defrag C:");

type error
is not recognized as an internal or external command operable program or batch file

Answer the question

In order to leave comments, you need to log in

6 answer(s)
V
Vapaamies, 2015-03-23
@dronreviews

Let's guess: you're trying to run a 64-bit defrag on a 64-bit OS from a 32-bit application? It is not recognized as an internal or external command operable program or batch file. :-)

V
Vladimir Martyanov, 2015-03-23
@vilgeforce

Try the full path.

M
Mikhail Lyalin, 2015-03-23
@mr_jok

give up the pernicious idea of ​​using defrag

D
dronreviews, 2015-03-23
@dronreviews

Immediately after the error tried, but the same.
works great

A
AxisPod, 2015-03-24
@AxisPod

And why are you using system? CreateProcess does not suit you? Read all the same to the dock in MSDN on the system, there, as it were, they hint for what it is used and how.

V
Vladislav Yaroslavlev, 2015-03-26
@vladon

system will not work, use CreateProcess from WinAPI

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question