SQL 2008

Posted on 2013-02-06
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?
Question by:spoye
  • 4
  • 3
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

Author Comment

ID: 38860766
Still nothing
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 38860800
just for testing,
try adding the service account as local admin on 'perseus'

Author Comment

ID: 38860848
done same issue?
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

LVL 75

Accepted Solution

Aneesh Retnakaran earned 250 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

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

Author Comment

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.
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 250 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".

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sql server lock cursor 13 47
SQL Server can be started but not accessed 1 26
Error in query 3 52
SQL Query 2 43
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 …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

929 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now