Both project files and decision files are text files. Project files do not know about their solution, so we will have to look for solutions for our projects.
The project entry in the solution file is as follows:
Project("{9AC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ProjectName", "ProjectDirectory\ProjectFileName.vcproj","{9A95F635-B74F-4640-BBCF-E324D0972CA9}"
EndProject
So, you can see, we can capture the project name and the relative path to the project file.
Using your favorite scripting language, you can do something like the following. (Example in ruby)
require 'find'
def project_name(string)
string =~ /= "(.+?)"/
$1
end
def project_path(string)
string =~ /, "(.+?)"/
$1
end
def find_projects(path)
puts "#{path} contains the following projects:"
open(path).read.gsub(/Project\(.+?EndProject/m) do |match|
puts project_name(match)
end
puts ""
end
Find.find(File.dirname(__FILE__)) do |path|
if FileTest.directory?(path)
if File.basename(path) =~ /^\../
Find.prune
else
next
end
elsif path =~ /\.sln$/
find_projects(path)
end
end