Note that there are some explanatory texts on larger screens.

plurals
  1. POC# CheckedListBox Marked Items Run Process + Process Flags + CheckedListBox fileName + Filename Extention
    primarykey
    data
    text
    <p>I'm trying to run a command prompt *.exe (also redirecting the cmd output to a textbox); that will use CheckedListBox marked items as the file-name &amp; extention for this program to complete the task.</p> <p>In other words; I'm Re-Creating an Windows-Android Apk Installer (for my own use &amp; educational purposes). When i have several items marked in CheckedListBox (or All Checked); i need the checkedListBox to run "adb install checkedlistbox marked items and file extention" to cmd.</p> <p>i.e: "adb install ~\path to my apk folder\ checkedliastbox1.filename.apk" </p> <p>The items shown inside CheckedListBox are files "populated from a folder with filtered extention".</p> <p>These are the codings i am trying to use; <strong>not working properly</strong>, ofcourse. What happens in both codes, is that it will open several cmd windows at the same time and it's not getting the checkedListbox1.selectedItems into the command prompt. In other words only show adb help.</p> <pre><code> private void btn_Install_Click(object sender, EventArgs e) { foreach (object itemChecked in checkedListBox1.CheckedItems) { Process.Start(@"C:\RGDnamics\programfiles\program.exe", "run " + checkedListBox1.SelectedItems); } } </code></pre> <p>While i've been learning C# theses few days; i've leaned and improved my coding using this. (Seems like i can control and understand better this way). </p> <pre><code> private void btn_install_Click(object sender, EventArgs e) { foreach (object itemChecked in checkedListBox1.CheckedItems) { p.StartInfo.FileName = @"C:\RGDnamics\Android\adb\adb.exe"; p.StartInfo.UseShellExecute = true; p.StartInfo.CreateNoWindow = false; p.StartInfo.Arguments = "install C:\\RGDnamics\\Android\\Backups\\Apk\\myapks\\" + itemChecked.ToString(); p.Start(); p.WaitForExit(); } </code></pre> <p>Any idea what i might be doing wrong? As i've been reading; i may be placing this code in the wrong section; else i may be forgetting to code ItemCheck; or ChangedIndex; but i'm not 100% familliar with it yet.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload