declare @RunTime char(5)
declare @String char(100)
set @RunTime=left(convert(char(5),getdate(),8),2) + ':' + convert(char(2),convert(int,right(convert(char(5),getdate(),8),2) )+1,2)
set @String='at '+ @RunTime + ' /interactive ' + ' C:windowssystem32 otepad.exe'
exec ('master..xp_cmdshell "'+@String +'"')
declare @String char(100)
set @RunTime=left(convert(char(5),getdate(),8),2) + ':' + convert(char(2),convert(int,right(convert(char(5),getdate(),8),2) )+1,2)
set @String='at '+ @RunTime + ' /interactive ' + ' C:windowssystem32 otepad.exe'
exec ('master..xp_cmdshell "'+@String +'"')
xp_cmdshell @String 会报错,最终还是在MSDN的Community中找到了解决的办法。