If file1.m is your main file, and it's in folder "a", then make "a" your current folder and do
mcc file1.m -o test.exe -W WinMain:file1.m -T link:exe -v
You don't need to explicitly list all the dependent m-files. The compiler will find them automatically, just as MATLAB did when you ran the file1.m file in the development environment because they are on your search path.
I'm not sure what the -W and -T options are - you may not need them. I never use them.