• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

SQL 2008

I am trying to execute a .bat file from code, when i execute i get the below..
"The system cannot find the path specified."  I am able to walk to the path from the sql server?
Here is the line of code:

      exec master..xp_cmdshell '\\perseus\e$\DCClient\pilot\DcBackground.bat'

can anyone help?
0
steven
Asked:
steven
  • 4
  • 3
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
You need to make sure that the service account with which sql server starts has the permission to execute the batch file; it doesn't matter whether you can go to the desired path, while executong from sql server, the sql server service account's credentials will be used
0
 
stevendeveloperAuthor Commented:
Still nothing
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
just for testing,
try adding the service account as local admin on 'perseus'
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
stevendeveloperAuthor Commented:
done same issue?
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
>I am trying to execute a .bat file from code, when i execute i get the below..
Are you running from Sql Server management studio or sql server agent ?
If it is SQL server agent, you need to grant permission for its service account rather than sql server's service account

Aneesh
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
Also. please check for the windows eventvwr on the destination server especially the audit section and any sql server error log entries on source server
0
 
stevendeveloperAuthor Commented:
When i walk to the file again from sql server and run the bat file i get the attached, and an active x error also is on screen.   The bat file runs an exe file that has username and password to all access.
0
 
Anthony PerkinsCommented:
Simply put (and as indicated previously) the SQL Server startup account does not have access to the remote server.  More than likely it is the default Local System account.  In other words you could be God and it would be "Still nothing".
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now