Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear,

How to open external exe file from SQL Query.

Thanks
Basit.

What I have tried:

I activate
SQL
USE master
GO
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE WITH OVERRIDE
GO

then pass query but not run below is query

DECLARE @command varchar(8000)
SET @command = 'C:\MyProgram.exe' 
EXEC master..xp_cmdshell @command


When i pass the query is not showing executing but not open exe file.

Thanks
Basit.
Posted
Updated 5-May-16 21:33pm
v2
Comments
Patrice T 6-May-16 3:06am    
Where is C:\MyProgram.exe, which PC ?
basitsar 6-May-16 11:47am    
same pc dear
Patrice T 6-May-16 12:22pm    
Client PC or server PC ?
basitsar 6-May-16 12:37pm    
Server PC. And SQL Management also on server. Only to open exe file through sql query.
What exactly want to create trigger when data inserted then open then exe file and run other things.

Thanks
Basit.
Bernhard Hiller 6-May-16 3:36am    
What is your program expected to do? Show a GUI? Or run in the background, reading some parameters from command line, ...

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900