Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_cmdshell

Status
Not open for further replies.

ntbuddy

IS-IT--Management
Mar 9, 2001
19
US
I'm trying to run xp_cmdshell. I'm logged into QueryAnalyzer as SA and have this problem so I know it's not a rights issue.

master.dbo.xp_cmdshell 'c:\efrx\frxa32.exe /c:fh /i:ytd-summary'

If I replace the items between the single quotes with DIR for directory I get results returned. If I try the command from a DOS prompt it works with no problems. I would like to run this from a stored procedure or from a .ASP web page.
 
Try creating a user DB Store Procedure to call the master XP_CMDSHELL procedure

something like this:

create procedure sp_CallMasterCMDShell
use master
go
xp_cmdshell 'c:\efrx\frxa32.exe /c:fh /i:ytd-summary'


then using ASP call the procedure like this
[/b]SQL = "sp_CallMasterCMDShell"

lemme know if works out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top