also to run this you need to have xp_cmdshell enabled
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell'
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/