December 15, 2006 at 7:51 am
I want to run an .exe in a SQL Server 2000 scheduled job that needs a parameter passed to it. I have set up the job by using CMDEXEC
Command:
C:\purge.exe 7
This runs but does not pass the 7 to the job so the job never ends until I manually cancel it. The jobs runs fine from a command line.
I would appreciate any help that could be sent my way.
December 15, 2006 at 9:43 am
i think if you use xp_cmdshell 'C:\purge.exe 7' it will work; I know I call executables with command line arguments like this all the tiem.
Lowell
December 15, 2006 at 10:07 am
I tried xp_cmdshell 'C:\purge.exe 7' but it failed immediately
reason: The system cannot find the file specified
It will try to run if the 7 is not there, but I need to pass the 7 to the job.
December 15, 2006 at 10:22 am
just a bit of clarification:
the program Purge.exe exists on the SQl server itself, right? not locally?
here's a typical example of what i might do: i put file contents in a text file, that i later read in another process
exec xp_cmdshell 'dir c:\*.* > c:\contents.log'
Lowell
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply