private void Format_Click(object sender, RoutedEventArgs e)
 {
     ProcessHandler.Prepare("diskpart", true, true, false);
     ProcessHandler.Start();
     tmp = "format fs=exfat label=VHD_Disk quick";
     ProcessHandler.WriteLine(tmp, true);
     ProcessHandler.Stop();
 }
 private void Unmount_Click(object sender, RoutedEventArgs e)
 {
     ProcessHandler.Prepare("diskpart", true, true, false);
     ProcessHandler.Start();
     tmp = "select vdisk file=\"" + fileaddress + "\"";
     ProcessHandler.WriteLine(tmp, false);
     tmp = "detach vdisk";
     ProcessHandler.WriteLine(tmp, true);
     ProcessHandler.Stop();
 }
        void DiskDesc()
        {
            ProcessHandler.Prepare("diskpart", true, true, false);
            ProcessHandler.Start();
            tmp = "select vdisk file=\"" + fileaddress + "\"";
            ProcessHandler.WriteLine(tmp, false);
            tmp = "detail vdisk";
            ProcessHandler.WriteLine(tmp, true);
            tmp      = ProcessHandler.ReadToEnd();
            tex.Text = textAnalyser(tmp, "Device type ID", "DISKPART>");

            ProcessHandler.Stop();
        }
Exemple #4
0
        private void Savebtt_Click(object sender, RoutedEventArgs e)
        {
            ProcessHandler._Filename = Input_txtbx.Text;
            Savebtt.IsEnabled        = false;
            Savebtt.Cursor           = Cursors.Wait;
            string tmp = "create vdisk file=\"" + Input_txtbx.Text + "\" maximum=" + Convert.ToInt32(ImageSize.Text) + "\"";

            if (ExpandableSize.IsChecked == true)
            {
                tmp += " type=EXPANDABLE";
            }
            if (FixedSize.IsChecked == true)
            {
                tmp += " type=FIXED";
            }
            ProcessHandler.Prepare("diskpart", true, true, false);
            ProcessHandler.Start();
            ProcessHandler.WriteLine(tmp, true);



            if (FormatChkBox.IsChecked == true)
            {
                Thread.Sleep(5000);
                ProcessHandler.Prepare("diskpart", true, true, false);
                ProcessHandler.Start();
                tmp = "select vdisk file=\"" + Input_txtbx.Text + "\"";
                ProcessHandler.WriteLine(tmp, false);
                tmp = "attach vdisk";
                ProcessHandler.WriteLine(tmp, false);
                tmp = "convert mbr";
                ProcessHandler.WriteLine(tmp, false);
                tmp = "create partition primary";
                ProcessHandler.WriteLine(tmp, false);
                tmp = "format fs=" + Format_type() + " label=VHD_Disk quick";
                ProcessHandler.WriteLine(tmp, false);
                tmp = "assign letter=z";
                ProcessHandler.WriteLine(tmp, true);
            }


            Savebtt.IsEnabled = true;
            Savebtt.Cursor    = Cursors.Arrow;

            ProcessHandler.Stop();
            this.Close();
        }