Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 xp_cmdshell

Author  Topic 

fahdmalik
Starting Member

6 Posts

Posted - 2008-01-09 : 10:57:32
I have a proxy account set up in SQL2005. This account is a regular user on the machine that has windows 2003 operating system. When I run the command
exec xp_cmdshell 'dir C:\1.txt' under the proxy account it runs fine
but when I run exec xp_cmdshell 'dir C:\1.txt | findstr 1.txt' or exec xp_cmdshell 'dir C:\1.txt | dir C:\1.txt' it throws the error "Access is Denied"

I have done the above on Windows XP and everthing works as it should. Is there something peculair in Windows 2003 server that I may be missing?

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2008-01-09 : 16:22:37
did you grant exec permissions on xp_cmdshell to the account that is failing? Just creating the sqlagent proxy account is not good enough.



-ec
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-01-09 : 22:34:49
Did you enable xp_cmdshell in sp_configure?
Go to Top of Page
   

- Advertisement -