从我的代码运行chkdsk [英] Running chkdsk from my code
本文介绍了从我的代码运行chkdsk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图通过一些代码在我的计算机上的c:(ntfs)上运行检查磁盘。
我可以启动shell并给它执行磁盘检查的命令但它
要求我输入y在cmd提示符中出现一些对话框之后。
有没有人有办法让这个工作?
谢谢
I am trying to run check disk on the c: (ntfs) on my computer via some code.
I can launch the shell and give it the command to do the disk checking but it
requires that I enter a "y" after some dialog in the cmd prompt comes up.
Does anyone have a way to make this work?
Thanks
推荐答案
为什么不使用Process.Start(" chkdsk.exe")并传递你想要的参数?b $ b想要什么?
-
-iwdu15
why not just use Process.Start("chkdsk.exe") and pass in the parameters you
want?
--
-iwdu15
因为当你这样做时,它不会运行检查磁盘。你认为我必须将磁盘标记为脏吗?
" iwdu15"写道:
because when you do that, it doesn''t run the check disk. Do you think I
would have to mark the disk as "dirty"?
"iwdu15" wrote:
为什么不只是使用Process.Start(" chkdsk.exe")并传入你想要的参数
想要?< br $> b $ b -
-iwdu15
why not just use Process.Start("chkdsk.exe") and pass in the parameters you
want?
--
-iwdu15
System.Diagnostics.Process.Start(" chkdsk。 exe"," C:")。WaitForExit();
对我来说很好......它是怎么做的不工作?
-
-iwdu15
System.Diagnostics.Process.Start("chkdsk.exe", "C:").WaitForExit();
worked for me just fine....how did it "not work"?
--
-iwdu15
这篇关于从我的代码运行chkdsk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文