简体   繁体   中英

Access denied to run exe file in stored procedure

i want to run exe file from stored procedure. But, output is 'Access is denied'. how can i do? my sql query is as the following. It is just testing query

EXEC master..xp_CMDShell 'C:\Users\myo.minlin\Downloads\Firefox Setup Stub 33.1.1.exe'

The reason is because your SQL-Server process runs, if not specified other, not with your myo.minlin account. The account which started the process does not have permissions on the file you provided. This is good so, because the database should not be able to access your private files. There are three or even more possible solutions:

  1. Move the file to a location where the SQL-Server has access to.
  2. Make sure that the account on which the SQL-Server is running has the right permissions to execute your file
  3. Launch the SQL Server process with the myo.milin account.

I do not reccommend solution 3. Solution 2 is also not reccommended if the file is in your home directory.

See Configure Windows Service Accounts and Permissions .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM