从 SQL 执行 Windows 程序
您知道如何从 SQL Server 执行 Windows 应用程序吗?我写了一个Windows应用程序(实际上它是一个EXE文件),当它双击运行时,它可以调用Skype(我正在开发Skype API)。但是当我尝试从 SQL 内部执行它时,它永远不会调用 Skype。
我使用了 SQL 中的 xp_cmdshell SP。我还尝试使用 CodeProject 中的这个解决方案。但它们都不适用于我: http://www.codeproject.com/KB /database/xyprocedure.aspx
任何帮助都表示感谢!
谢谢和问候, 狮子座
Do you know how can I execute a Windows application from SQL server? I have written a Windows application (actually it is a EXE file), when it runs by double clicks, it can call to Skype (I am working on Skype API). But when I try to execute it from inside SQL, it will never call to Skype.
I have used xp_cmdshell SP from SQL. I also tried to use this solution from CodeProject. But both of them did not work for me: http://www.codeproject.com/KB/database/xyprocedure.aspx
Any help is appriciated!
Thanks and regards,
Leo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您通过 xp_cmdshell 执行外部应用程序时,它将由 SQL Server 服务帐户在服务桌面上运行。 Skype 可能正在交互式桌面上以您的帐户运行。用这种方法你不可能成功。服务并不意味着以这种方式直接与客户端程序交互。
相反,您必须创建在您的凭据下在您的桌面上运行的小程序。该程序会定期检查数据库中的某种工作队列。每个工作项应该包含小程序能够与Skype交互所需的信息。
When you execute an external application through xp_cmdshell it will be run by the SQL Server Service account, on the Services desktop. Skype is probably running under your account on the interactive desktop. It's no way you can succeed with that approach. Services are not meant to directly interact with a client program that way.
Instead you have to create small program that runs on your desktop under your credentials. That program would regularly check some kind of work queue in the database. Each work item should contain the information that the small program needs to be able to interact with Skype.