0

:) 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 ? ?
-------------------------------------------------------------------------------------

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by g2gayan
0

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"
0

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 ;)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.