Improve company productivity with a Business Account.Sign Up

x
?
Solved

SQL 2008

Posted on 2013-02-06
10
Medium Priority
?
332 Views
Last Modified: 2013-03-03
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
Comment
Question by:steven
  • 4
  • 3
8 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 38860580
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
 

Author Comment

by:steven
ID: 38860766
Still nothing
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 38860800
just for testing,
try adding the service account as local admin on 'perseus'
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 

Author Comment

by:steven
ID: 38860848
done same issue?
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 750 total points
ID: 38860948
>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
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 38860956
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
 

Author Comment

by:steven
ID: 38861112
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
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 750 total points
ID: 38866487
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question