Made a proc from it, I'll certainly use it
ALTER PROCEDURE [dbo].[MoveFiles]
(
@fileName NVARCHAR(1000),
@SourceDirectory NVARCHAR(1000),
@DestinationDirectory NVARCHAR(1000)
)
AS
BEGIN
SET NOCOUNT ON
DECLARE
@TodayDate VARCHAR(40),
@TodayHour VARCHAR(40),
@TodayMinu VARCHAR(40),
@NewFileName VARCHAR(100),
@cmdstr VARCHAR(128)
SELECT @TodayDate = CONVERT(varchar(10), GETDATE(), 112)
SELECT @TodayHour = DATEPART(hh,GETDATE())
SELECT @TodayMinu...