Results 1 to 2 of 2

Thread: xp_cmdshell running as a sql agent job

  1. #1
    Join Date
    Aug 2004
    Posts
    188

    xp_cmdshell running as a sql agent job

    I have created a job that runs this code:

    exec master..xp_cmdshell 'D:\Trace_output\Auto_perfmon\Autoperfmon.bat'

    This runs fine as long as I place the counter.txt file in the windows\system32 dir.

    The bat file has this code:


    typeperf -cf counter.txt -o D:\Trace_output\Auto_perfMon\autoperf

    This starts without any issues and i see typeperf.exe in the taskmanger.

    The question i have is how can i stop this without having to go into taskmanager and killing typeperf.exe?

    thanks for your time

  2. #2
    Join Date
    Aug 2004
    Posts
    188
    I think I figured it out.

    I can create another .bat file with this command.

    Kill -f typeperf.exe

    this will kill the process

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •