Link to home
Start Free TrialLog in
Avatar of SQLNewBieUSA
SQLNewBieUSA

asked on

XP_CMDSHELL store procedure keep running on SQL Server 2005 - What could be the problem ?

Hi Friends,

I have One Winows Application.

When I run Windows Application EXE, it is running well and finishing up in 1 Min. duration.

When I Exeucte this Exe from XP_CMDSHELL , it is keep running on SQL Server.

Execute MAster..XP_CMDSHELL 'C:\Test.Exe'

Can anyone guide me, why it is keep running through XP_CMDSHELL ?

Thanks.
Avatar of dba2dba
dba2dba

two possibilities:

1) If you try to execute a program that requires user input, the xp_cmdshell process will hang. Some command line utilities are interactive and you need to set some switches so that it runs in quiet mode, maybe this utility works that way too.

2) The Account SQL Server is running should have the necessary privileges to run the program. When you run from command prompt, it runs under your account while in xp_cmdshell it runs under sql service account.
ASKER CERTIFIED SOLUTION
Avatar of ThakurVinay
ThakurVinay

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SQLNewBieUSA

ASKER

dba2dba --

Thanks for replying me.

My XP_CMDSHELL only required path for .EXE.

I am just trying to call .EXE file from XP_CMDSHELL - it does not need any other parameter or user interaction.

pls correct me if i am wrong