Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_cmdshell can't see unc path?

Status
Not open for further replies.

equus2

Programmer
Mar 5, 2008
36
US
Hi,

I am running this under my windows login in ssms, which is administrator on the server:

declare @cmd varchar(100)
set @cmd = 'dir \\networkpath\file'
exec xp_cmdshell @cmd

ERROR:
The network path was not found.

Is this a permissions problem? Why can't xp_cmdshell see the unc path?

Thanks
 
xp_cmdshell runs under the permissions of the account that is used to start the SQL Server service.

Click Start -> Run
Type Services.msc
Click OK

Scroll down to SQL Server
Right Click -> Properties
Click 'Log On' tab.

Usually, 'Local System Account' is the 'Log on as'. Local system has full rights to the local computer, but usually no rights to any other machine.

You can specify another account, one with more privileges, but you run the risk of making your server less secure by doing this.


-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
The name of the service is SQL SERVER for SQL 2005. For SQL 2000, the name of the service is MSSQLSERVER.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top