Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

Using xp_cmdshell Expand / Collapse
Author
Message
Posted Saturday, July 26, 2008 1:07 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 1:19 PM
Points: 9,294, Visits: 9,491
Please provide examples of your code for those cases where the CMD.EXE's are hanging around.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #541437
Posted Saturday, August 2, 2008 4:19 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, December 7, 2011 1:46 AM
Points: 2, Visits: 11
Thanks for response but i have figured out the problem.it was about bad exception handling.
Post #545617
Posted Thursday, October 23, 2008 2:24 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 14, 2012 3:37 PM
Points: 34, Visits: 110
I have the same problem. My cmd.exe left open even the processes is already completed.


EXECUTE xp_cmdshell '"D:\Folder\Task.exe" & exit'

Can you please help me to solve this.

Thanks!
Post #590787
Posted Thursday, October 23, 2008 2:35 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 1:19 PM
Points: 9,294, Visits: 9,491
When I try to execute this I get "The system cannot find the path specified."

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #590795
Posted Thursday, October 23, 2008 2:42 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 1:19 PM
Points: 9,294, Visits: 9,491
By the way, I would not use the " & Exit". It should not be necessary and it may be what is causing your problem.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #590800
Posted Thursday, October 23, 2008 2:44 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 14, 2012 3:37 PM
Points: 34, Visits: 110
I tried this but still give me the same problem. everything run ok it juts leave the cmd open

EXECUTE xp_cmdshell '"D:\Folder\Task.exe"
Post #590802
Posted Thursday, October 23, 2008 3:09 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 1:19 PM
Points: 9,294, Visits: 9,491
How do you know that the process actually completed, if it never returns?

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #590820
Posted Thursday, October 23, 2008 3:22 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 14, 2012 3:37 PM
Points: 34, Visits: 110
it gives result to our SQL database.
Post #590826
Posted Thursday, October 23, 2008 3:26 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 1:19 PM
Points: 9,294, Visits: 9,491
That does not mean that it is completed. It could be still hanging around trying to read command input from somewhere or something (that will never come, obviously). It all depends on how your "Task.exe" command is written.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #590829
Posted Thursday, October 23, 2008 3:29 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 14, 2012 3:37 PM
Points: 34, Visits: 110
Actually I suspect that... hmmm is there anyway I can kill the cmd.exe in SQL.

Thanks!
Post #590833
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse