I originally tried doing this using xp_cmdshell but, it kept hanging so I tried this (which i found via search) and it worked:
CREATE PROCEDURE dbo.sp_cmdshell(@cmd varchar(255), @Wait int = 0) AS
--Create WScript.Shell object
DECLARE @result int, @OLEResult int, @RunResult int
DECLARE...