怎么把FAT转换成NTFS? [英] How to convert FAT to NTFS?

查看:111
本文介绍了怎么把FAT转换成NTFS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从这段代码开始,但是什么也没发生:

无效ToNTFS()
{
CMD(@"convert i:/fs:ntfs");
}


无效CMD(字符串cmdline)
{
ProcessStartInfo startInfo =新的ProcessStartInfo("CMD.exe");
进程p = new Process();
startInfo.RedirectStandardInput = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.CreateNoWindow = false;
p = Process.Start(startInfo);
p.StandardInput.WriteLine(cmdline);
//p.StandardInput.WriteLine(@"EXIT");
p.WaitForExit();
p.Close();
}

Hi, I try to start from this code, but nothing happens:

void ToNTFS()
{
CMD(@"convert i: /fs:ntfs");
}


void CMD(string cmdline)
{
ProcessStartInfo startInfo = new ProcessStartInfo("CMD.exe");
Process p = new Process();
startInfo.RedirectStandardInput = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.CreateNoWindow = false;
p = Process.Start(startInfo);
p.StandardInput.WriteLine(cmdline);
// p.StandardInput.WriteLine(@"EXIT");
p.WaitForExit();
p.Close();
}

推荐答案

我认为您还需要在CMD语法中添加一个/C.

I think you also need to add a /C to your CMD Syntax.

C:\>cmd /?
Starts a new instance of the Windows command interpreter
CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OF
    [[/S] [/C | /K] string]
/C      Carries out the command specified by string and then terminates



不会转换FAT-> NTFS在下次重新启动计算机时发生.
自从我最初不记得格式化机器FAT以来,已经很久了.



Doesn''t the conversion of FAT -> NTFS take place upon next restart of the machine.
It''s been so long since I initally formatted a Machine FAT i can''t remember.


这篇关于怎么把FAT转换成NTFS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆