" /> launching an application from URS - Genesys CTI User Forum

Author Topic: launching an application from URS  (Read 3851 times)

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1419
  • Karma: 18
launching an application from URS
« on: September 26, 2006, 05:54:23 AM »
Advertisement
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

Offline Haldane

  • Jr. Member
  • **
  • Posts: 72
  • Karma: 1
Re: launching an application from URS
« Reply #1 on: September 26, 2006, 10:17:47 AM »
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.


Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1419
  • Karma: 18
Re: launching an application from URS
« Reply #2 on: September 28, 2006, 03:43:51 AM »
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...

Offline LeszekM

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Re: launching an application from URS
« Reply #3 on: September 28, 2006, 04:25:01 PM »
In MS SQL you have got the "xp_cmdshell" system extended stored procedure.

Regards
Leszek

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: launching an application from URS
« Reply #4 on: September 29, 2006, 05:13:45 AM »
Awesome! This can solve a $4000 develpment Genesys was trying to sell me! Will try ASAP!

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1419
  • Karma: 18
Re: launching an application from URS
« Reply #5 on: October 10, 2006, 03:03:29 AM »
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:

« Last Edit: October 10, 2006, 03:07:01 AM by victor »