i have developed one solution with three projects using C# and created exe file from it.
if i run exe file by clicking or from command prompt it is working without any trouble.
but if i run It from sqlserver xp_cmdshell passed by the path where my exe file resides
Example
exec master..xp_cmdshell 'D:\Outosms\tester.exe'.
it is not working
3. i have also used the following code to run it inside asp.net/vb.net code
----------------
Dim myProcess As New System.Diagnostics.Process
Dim myInfo As New System.Diagnostics.ProcessStartInfo
myInfo.FileName = Server.MapPath("OutoSMS\Release\Tester.exe")
myInfo.RedirectStandardOutput = True
myInfo.UseShellExecute = False
myProcess.StartInfo.CreateNoWindow = False
myProcess = System.Diagnostics.Process.Start(myInfo)
'myProcess.Start()
myProcess.Close()
-----------
but unforgunately none of both step3 and 4 solutions solved my problem that is why i am requesting urgent help if there is any help.
for xp_cmdshell to work in sql server, u will need to put the exe on database server system's (not local) path... that means, if sql server is remote machine, then u have to put exe on d:\ drive of sql server system
also, the vb.net code u r using to run the seprate process (.exe) has the myProcess.Start() method commented
hope this helps...
Cheers!
KK
Please mark as Answer if post helps in resolving your issue
My Site
Try to connect database with windows authentication and user must have permission to run exe file. Generally you can run xp_cmdshell with Local box administrator account. Assuming sql server and exe file on same box.
caligeesey
0 Points
3 Posts
runing asp.net exe file from sqlserver or runing it in asp.net code
Dec 31, 2012 05:08 AM|LINK
Example
exec master..xp_cmdshell 'D:\Outosms\tester.exe'.
it is not working
3. i have also used the following code to run it inside asp.net/vb.net code
----------------
Dim myProcess As New System.Diagnostics.Process
Dim myInfo As New System.Diagnostics.ProcessStartInfo
myInfo.FileName = Server.MapPath("OutoSMS\Release\Tester.exe")
myInfo.RedirectStandardOutput = True
myInfo.UseShellExecute = False
myProcess.StartInfo.CreateNoWindow = False
myProcess = System.Diagnostics.Process.Start(myInfo)
'myProcess.Start()
myProcess.Close()
-----------
but unforgunately none of both step3 and 4 solutions solved my problem that is why i am requesting urgent help if there is any help.
best regards
kedarrkulkar...
All-Star
34013 Points
5468 Posts
Re: runing asp.net exe file from sqlserver or runing it in asp.net code
Dec 31, 2012 05:15 AM|LINK
for xp_cmdshell to work in sql server, u will need to put the exe on database server system's (not local) path... that means, if sql server is remote machine, then u have to put exe on d:\ drive of sql server system
also, the vb.net code u r using to run the seprate process (.exe) has the myProcess.Start() method commented
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
urenjoy
Star
12027 Points
1807 Posts
Re: runing asp.net exe file from sqlserver or runing it in asp.net code
Dec 31, 2012 05:17 AM|LINK
Try to connect database with windows authentication and user must have permission to run exe file. Generally you can run xp_cmdshell with Local box administrator account. Assuming sql server and exe file on same box.
caligeesey
0 Points
3 Posts
Re: runing asp.net exe file from sqlserver or runing it in asp.net code
Dec 31, 2012 05:48 AM|LINK
i have did whatever related to authentications but nothing has changed.