Running the risk of sounding like a smartar.. 🙂 Your example is as bad as the 'tested' code I get from my users. You know SQL server can create files but not directories. Nice point though regarding mdf, ldf, ndf
perhaps include:
exec xp_cmdshell 'MD c:\mssql'
go
cheers