Open Folder and Select multiple files

Posted by Vytas999 on Stack Overflow See other posts from Stack Overflow or by Vytas999
Published on 2010-04-12T07:27:18Z Indexed on 2010/04/12 7:53 UTC
Read the original article Hit count: 361

Filed under:
|
|
|

In C# I want to open explorer and in this explorer window must be selected some files. I do this like that:

        string fPath = newShabonFilePath;

        string arg = @"/select, ";

        int cnt = filePathes.Count;
        foreach (string s in filePathes)
        {
            if(cnt == 1)
                arg = arg + s;
            else
            {
                arg = arg + s + ",";
            }
            cnt--;
        }

        System.Diagnostics.Process.Start("explorer.exe", arg);

But only the last file of "arg" is selected. How to make that all files of arg would be selected, when explorer window is opened..?

© Stack Overflow or respective owner

Related posts about c#

Related posts about explorer