终于被我找到了,谢谢楼上兄弟的鼓励!
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
go
RECONFIGURE
GO
EXEC sp_configure 'show advanced options', 0
GO
RECONFIGURE
GO
EXEC master..xp_cmdshell 'if not exist D:\abc (md D:\abc)'--新建文件夹
EXEC master..xp_cmdshell 'if exist D:\abc (del /q D:\abc)'--删除文件
EXEC master..xp_cmdshell 'if exist D:\abc (rd /q D:\abc)'--删除文件夹
Go
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 0
go
RECONFIGURE
GO
EXEC sp_configure 'show advanced options', 0
GO
RECONFIGURE
GO