How is it possible to run a command line app on all checked items in a checkedlistbox ?
I added my files to the listbox with this code:
private void button2_Click(object sender, EventArgs e)
{
var filters = "*.avi|*.mkv";
odd.ShowNewFolderButton = false;
if (odd.ShowDialog() == DialogResult.OK)
{
string folderName = odd.SelectedPath;
string[] files = Directory.GetFiles(folderName, "*.*", SearchOption.AllDirectories);
foreach (string file in files) checkedListBox1.Items.Add(file, CheckState.Checked);
}
}
Now i want to that x264.exe with parameters process (convert) all (checked) items added to the listbox
I’m not sure to have fully understood your question but if you want to run a command for each checked element in a checkedlistbox you can use a for each loop through all the checked item :