You are here: Re: Using sql to execute a batch file, xp_cmdshell « MsSQL Server « IT news, forums, messages
Re: Using sql to execute a batch file, xp_cmdshell

Posted by Roy Harvey on 08/10/07 20:23

On Thu, 09 Aug 2007 21:23:07 -0000, mcolson <mcolson1590@gmail.com>
wrote:

>When I use the xp_cmdshell to try and run the bat file, i get an
>output saying access denied. It should be noted that I am using sql
>server 2005 express. Is this why. When I try to copy the file to
>another location, i get 0 copied. I am able to dir the directory just
>fine.

I am not familiar with Express, but I don't think it is any different
in this area. What is important to remember is that any command run
through xp_cmdshell is running under the account designated for that,
and that is the account that needs the permissions. Running
xp_cmdshell 'set' and inspecting the results should tell you the
account being used.

While it does not appear to be your problem it is worth noting also
that xp_cmdshell runs in a context without any mapped drives, so any
files on a network drive must be referenced using a UNC path of the
form \\servername\sharename\folder...

Roy Harvey
Beacon Falls, CT

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация