Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL 2008

Posted on 2013-02-06
10
Medium Priority
?
327 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
10 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

636 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