Genesys CTI User Forum
Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: victor on September 26, 2006, 05:54:23 AM
-
Dear all,
a quick and painless question:
I need to launch a batch file from within a strategy. Can this be done without using custom server?
We are talking about solaris, and I am not too keen on programming.
Thanks,
Vic
-
I tried to do something like this in 6.5 but could only do it through a custom server. I then found an easier way via a stored porc. It was on Oracle so I used the DBMS.PIPE command, in which you can pipe out an OS command. Not sure how to do this in SQLserver. Maybe ask your DBA.
-
Launching something through a stored procedure in Oracle. :o
This is something I can imagine doing. I wonder the stored procedure would be in SQL server...
-
In MS SQL you have got the "xp_cmdshell" system extended stored procedure.
Regards
Leszek
-
Awesome! This can solve a $4000 develpment Genesys was trying to sell me! Will try ASAP!
-
Ok, thanks to everyone, I figured out a solution :)
xp_cmdshell does the trick.
Here is how it works:
exec master.dbo.xp_cmdshell 'copy c:\temp\a.txt c:\temp\workfile.txt'
this will copy a.txt into workfile.txt
if you need to analyze return value, then try this:
DECLARE @rc int
EXEC @rc = master.dbo.xp_cmdshell 'copy c:\temp\a.txt c:\temp\workfile.txt'
print @rc
IF @rc <> 0
BEGIN
PRINT 'Copy Failed'
END
ELSE
BEGIN
Print 'Copy worked'
....
END
And then, all you need to do is call it from URS. I think you know how to do this, so I will let you be.
In case you don't here we go: