从另一台计算机上的SQL代理作业中在一台计算机上执行DOS批处理文件 [英] Executing a DOS batch file in one machine from a sql agent job in another machine

查看:126
本文介绍了从另一台计算机上的SQL代理作业中在一台计算机上执行DOS批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想从另一台计算机(DB服务器)中的sql代理作业中在一台计算机(应用程序服务器)中执行DOS批处理文件.我可以这样吗?如果是这样,请让我知道如何进行此操作.

谢谢

Hi all,
I want to Execute a DOS batch file in one machine (Application server) from a sql agent job in another machine (DB Server). Can I do like this? if so, please let me know how to proceed on this.

Thanks

推荐答案

这可能会帮助您完成任务: PSExec [ ^ ]该工具可是Mark Russinovich无与伦比的SysInternals工具箱的一部分.它使您可以远程执行程序.我经常将它用于无法直接访问的计算机上的管理目的.我们当然可以通过NetSupport登录到计算机,但是通过命令提示符的psexec命令要快得多. :)

最好的问候,

-MRB
This may help you in your quest: PSExec[^] a tool that is part of Mark Russinovich''s unsurpassed SysInternals Toolbox. It lets you execute programs remotely. I use it often for administration purposes on machines we don''t have direct access to. We could of course log on to the machines via NetSupport, but a psexec command via command prompt is a whole lot faster. :)

Best Regards,

-MRB


仅需注意:批处理文件不再是DOS批处理文件,而不再是DOS批处理文件.并且语法得到了实质性的改进.

我认为,如果不在DB服务器计算机上创建某些网络服务(如果此服务器是Windows,则为Windows服务),而在Application Server计算机上创建其客户端,就无法做到这一点.但是,这会破坏批处理文件的目的.您可以实现一些语义命令.无论如何,即使您在数据库服务器端使用批处理文件(对于.NET或Mono,也可以使用System.Diagnostics.Process.Start),在客户端(应用程序服务器)的命令本身也应该纯粹是语义上的,没有任何概念的批次.但是,最终的设计取决于您.

我不想在实现上添加任何更多细节,因为您没有标记平台或语言或任何其他细节.

—SA
Just a note: a batch file is not a DOS batch file anymore, since XP, I think; and the syntax is essentially improved.

I don''t think you can do it without creation of some network service (Windows Service if this server is Windows) on the DB server machine and its client on Application server machine. However, this would defeat the purpose of batch files; you can implement some semantic commands. Anyway, even if you use batch files on the DB server side (in case of .NET or Mono you can use System.Diagnostics.Process.Start), the command itself on the client side (of the Application server) should be purely semantic, without any notion of batch. However, the final design is up to you.

I don''t want to add any more detail on the implementation, because you did not tag your platform(s) or language or any other details.

—SA


这篇关于从另一台计算机上的SQL代理作业中在一台计算机上执行DOS批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆