Why can't I use RCMD.EXE via xp_cmdshell from SQL Server?

A. For any access to "network resources" you need to run SQL Server under a user account and not the default LocalSystem account. You can check what userid that MSSQLSERVER is running under by looking at control panel/services highlighting MSSQLSERVER and choosing the start-up option. This should be changed as necessary.

Without this change you will get an "error 5 - Access denied".

However, RCMD.EXE doesn't seem to work even with this change. This is due to the way that RCMD in the NT resource kit is coded - it is probably expecting there to be a keyboard/mouse defined in the user context, which there isn't.

So the short answer is that unless you use a version of rcmd.exe without this restriction then it won't work.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.