XCopy is capable of searching all subdirectories of a hard drive. A lot of DOS commands can. Robocopy and Dir are just two other examples.
See http://technet.microsoft.com/en-us/library/bb491035.aspx and see what the E, S and T switches do.
Here's a simple batch file that will do what you want
mkdir c:\test
dir C:\Users\YOUR_NAME\*.jpg /b /s > c:\test\output.txt
for /F "tokens=*" %%a in (c:\test\output.txt) DO copy "%%a" C:\test
mkdir - makes a new directory
the dir command looks for all jpg files in your computer profile and creates a text file listing all the files found
The for command uses the text file made to find and copy all the files in the list that dir made to the directory you made in the first line.
There are methods of writing this all one line where you use the output of the dir command as the input to another command. Read up on "pipes" and "redirection" in batch files and DOS
Unless you have some overiding need to use a batch file then simply use Windows search feature.