This requires that you enable xpcmdshell which increases the attackable surface area of your SQL Server installation. I would advise against it. Use PowerShell to do scripting tasks that involve the file system...if you absolutely must access the file system through T-SQL use the SQL CLR instead and have xpcmdshell disabled.
commented on Apr 8 2011 3:47PM