how search all *.mp3 and *.wav files in my computer? Visual Studio 2015, Universal Windows App, C++/CX. Thanks
Asked
Active
Viewed 107 times
0
-
1This isn't very clear. Do you want to search from Visual Studio, or in any way? If it's the latter, this should be moved to SuperUser. – kdbanman Jun 22 '15 at 18:26
-
Universal windows app - I can use only VS's namespaces for C++/CX, in Win32 it is easy. – German Polyansky Jun 22 '15 at 18:44
2 Answers
1
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 the musicLibrary
capability and then use KnownFolders.MusicLibrary
as the root folder to search. If you really want to search the entire drive, you need to use FolderPicker
and ask the user to select the root directory.

Peter Torr - MSFT
- 11,824
- 3
- 18
- 51
0
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()

Jenia
- 374
- 1
- 4
- 15