• John Mitchell-245523 - Friday, February 24, 2017 3:50 AM

    When you do it via a command prompt, it runs as you.  When you do it through xp_cmdshell, it runs as the SQL Server service account.  You need to ensure that the service account has permission to run x:\rs.exe, and also permissions on the share that you mapped to.  If the share is on another computer, you'll need to change the service account to a domain account in order for it to have access to the network (NT SERVICE\MSSQLSERVER is a local account).

    John

    Hi John

    I cant add the accout NT SERVICE\MSSQLSERVER to have access to the mapped drive. I've tried each and everyway of adding the account NT SERVICE\MSSQLSERVER to the shared directory, but the Windows cant "find" the account. I've tried with quotes, brackets, with the NT service, without it, and each and every other way. but Im not having any luck adding the account to the share. I've almost given up on this and thats why Im looking to run the cmdshell as a different user.

    PS, all of this runs on one server and no maps to any other servers.

    Thanks