how search all *.mp3 and *.wav files in my computer? Visual Studio 2015, Universal Windows App, C++/CX. Thanks
Search file *.mp3 in computer
111 views Asked by German Polyansky At
2
There are 2 answers
0
On
If you want to search in cmd (console):
C:\> where *.mp3
Or maybe search in disk D: not using cd command:
C:\> where /R D:\ *.mp3
In C++ code(to show the user):
#include<windows.h>
#include<string>
using namespace std;
//Be carefull: dont use: "C:\Folder\", but: "C:\\Folder\\"; In some cases you can write: "C:/Folder/"
string command = "where /R Disk:\\StartSearchFolder\\ filename"; //filename can be "ex.txt", "*.txt", "ex*";
system(command.c_str());
Can be helpful use ShellExecute()
The only way to read the user's files (pictures, music, etc.) is to use the
StorageFolder
APIs. If you assume the music is all inside the Music library, you can simply declare themusicLibrary
capability and then useKnownFolders.MusicLibrary
as the root folder to search. If you really want to search the entire drive, you need to useFolderPicker
and ask the user to select the root directory.