Restart Server
----------------------
USE master
go
-- On Monday Executes
IF (DATEPART(DW,GETDATE()) = 2)
BEGIN
EXEC Master.dbo.Sp_Configure 'Show Advanced Options', 1
RECONFIGURE
EXEC Master.dbo.Sp_Configure 'XP_CmdShell', 1
RECONFIGURE
EXEC Master.dbo.xp_cmdshell 'C:\WINDOWS\system32\shutdown.exe /r'
EXEC Master.dbo.Sp_Configure 'Show Advanced Options', 1
RECONFIGURE
EXEC Master.dbo.Sp_Configure 'XP_CmdShell', 0
RECONFIGURE
END
No comments:
Post a Comment