Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SQL 2008

Posted on 2013-02-06
10
Medium Priority
?
330 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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

571 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