:) Hey , Im creating a small application to convert pendrives from FAT format to NTFS :|

but i have a small problem..

Process p = new Process();
            string d = txtPath.Text.ToString();
            d = d.Substring(0, 2);
            p.StartInfo = new ProcessStartInfo("cmd", "/c \"format '+ d' /fs:ntfs" );
            p.Start();
            p.Close();

using the Above code, what i do is format a selected partition ...
but i want to format it using nfts system...

the cmd code would be format X /fs:ntfs
x = drive letter

what i want to do is to replace the X with my selected data from the listbox,, i tried this

format '+ d' /fs:ntfs

it ddint work fine,, experts,, have you got an idea to do this ? ? ?

Thanks in advance ;)

-------------------------------------------------------------------------------------
* Note - Extra stuff
instead of showing the percentage & stuff on CMD , can i show it on the C# form it self ? ?
-------------------------------------------------------------------------------------

Recommended Answers

All 2 Replies

Hello,
to extract the value of your d variable into given string, you should:

  1. Close declaration of string with double quotes
  2. Concatenate the value of your variable with the rest of your string

Here's what I'm talking about:

"/c \"format " + d + " /fs:ntfs"

Hello,
to extract the value of your d variable into given string, you should:

  1. Close declaration of string with double quotes
  2. Concatenate the value of your variable with the rest of your string

Here's what I'm talking about:

"/c \"format " + d + " /fs:ntfs"

Thanks Sir .. it works great.. 1 more question ,, how can i accsess diskpart and its listvolume and selectvolume parameters via C# ?

Any Ideas Sir ?

Tnz in advance ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.