1.将OutLook.exe注册为服务,让其一直保持开启状态

类似于TaobaoProtect.exe是由TBSecSvc服务启动的

http://stackoverflow.com/questions/3582108/create-windows-service-from-executable#

You can use sc.exe (required when using Powershell):

sc create <new_service_name> binPath= "<path_to_the_executable>"

(must have quotation marks around the actual exe path)

More info is available from Microsoft KB.

需要注意的是binPath=后面有一个空格,千万不要漏掉。

C:\Windows\System32>sc create OutLook binPath= "C:\Program Files (x86)\Microsoft
Office\Office12\OUTLOOK.EXE"
[SC] CreateService 成功

控制面板-->管理工具-->服务
找到刚才新建的服务,设置启动类型为自动

启动服务的时候,一直提示Error 1053

貌似需要exe本身支持服务才可以

http://stackoverflow.com/questions/12560727/trouble-with-running-myprogram-exe-as-service-on-windows-2008

https://msdn.microsoft.com/en-us/library/windows/desktop/ms686953(v=vs.85).aspx

http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service

You get the first error because your batch file is unable to negotiate/interact with the Windows Services subsystem. When Windows starts a Service, the OS waits a few seconds for the Service to report that is has started properly. If this signal never arrives (as with your batch file, which doesn't know anything about Services), Windows will report error #1053.

You will need a "wrapper" application to run your batch file as a service. The free "SRVANY" utility from Microsoft may work for you but you should investigate the more fully-featured commercial alternatives as well.

============

做了个bat脚本,比较麻烦

cd "C:\Program Files (x86)\Microsoft Office\Office12"
OutLook.exe
exit

2.使用第三方的插件

https://superuser.com/questions/189905/how-to-make-outlook-2010-minimize-when-i-try-to-close-it

outlook2010测试失败

将OutLook.exe注册为服务,让其一直保持开启状态的更多相关文章

  1. 如何将exe注册为windows服务,直接从后台运行

    方法一:使用windows自带的命令sc 使用sc create 方法创建. 如:注册服务 sc create ResharperServices binpath= D:\ResharperServi ...

  2. Windows Server下把BAT批处理注册成服务在后台运行且注销后能正常运行

    批处理有如下特点: 1.登录到当前窗口运行时,如果关闭控制台会连同启动的程序一起关闭. 2.如果是以start /b的形式启动,那么同样也是在控制台关闭后者注销当前窗口也会一起关闭. 3.如果以vbs ...

  3. 把应用程序exe 注册成为windows 服务的方法

    由于在Windows 服务器上必须要启动一个软件,提供外网访问内网的客户端软件,但是由于每次远程服务器之后会注销当前用户,所以客户端软件就会自动退出,那么我在外网的系统就不能支持访问了. 解决方案:将 ...

  4. 把exe注册为windows服务

    1.需要工具 Instsrv.exe(可以给系统安装和删除服务) Srvany.exe(可以让程序以服务的方式运行) 2.运行cmd,输入注册服务命令 "instsrv.exe完整路径&qu ...

  5. Nginx的使用(三)把nginx和php-cgi.exe注册成windows服务

    1.创建windows服务用到一个小工具WinSW:https://github.com/kohsuke/winsw/releases(下载 .exe 文件即可,根据系统选择,Win 10 选择 .N ...

  6. 怎样把exe程序注册成系统服务

    怎样把exe程序注册成系统服务 最近一段时间我们公司开发一款新的产品,要在服务器上运行一个服务端程序,为了方便我就希望能将这个程序注册成系统服务开机自动启动而不用每次重启系统都要手动启动程序.要实现这 ...

  7. 在64位windows下使用instsrv.exe和srvany.exe创建windows服务[转]

    本文转自:https://www.iflym.com/index.php/computer-use/201205020001.html 在32位的windows下,包括windows7,windows ...

  8. 在64位windows下使用instsrv.exe和srvany.exe创建windows服务

    在64位windows下使用instsrv.exe和srvany.exe创建windows服务   在32位的windows下,包括windows7,windows xp以及windows 2003, ...

  9. nginx 注册为服务

    使用java service wrapper将java程序注册为windows服务 分类:Java (5677)  (8) 将java注册为windows服务后,我们就直接可以通过windows的服务 ...

随机推荐

  1. JavaScript jQuery 事件、动画、扩展

    事件 因为JavaScript在浏览器中以单线程模式运行,页面加载后,一旦页面上所有的JavaScript代码被执行完后,就只能依赖触发事件来执行JavaScript代码. 浏览器在接收到用户的鼠标或 ...

  2. PHP加解密相关函数

    openssl_public_encrypt()  - Encrypts data with public keyopenssl_public_decrypt()  - Decrypts data w ...

  3. Oracle 动态视图1 V$LOCK

    v$lock显示数据库当前持有锁情况 Column Datatype Description SID NUMBER 会话ID TYPE VARCHAR2(2) 表示锁的类型.值包括TM,TX,等 ID ...

  4. Oracle 执行计划说明

    生成SQL的执行计划是Oracle在对SQL做硬解析时的一个非常重要的步骤,它制定出一个方案告诉Oracle在执行这条SQL时以什么样的方式访问数据:索引还是全表扫描,是Hash Join还是Nest ...

  5. N皇后问题2

    Description Examine the  checkerboard below and note that the six checkers are arranged on the board ...

  6. hadoop可能遇到的问题

    1.hadoop运行的原理? 2.mapreduce的原理? 3.HDFS存储的机制? 4.举一个简单的例子说明mapreduce是怎么来运行的 ? 5.面试的人给你出一些问题,让你用mapreduc ...

  7. sybase convert 函数

    1.从string到int的转换 convert(int,@string) select convert( int , '15') 2. 从int 到 decimal 的转换 convert(deci ...

  8. bootstrap 框架选型过程

    1.看有没有帮助文档,帮助文档的完整程度. 2.是否是我们业务需要的,花哨的功能真的有用吗? 对于偏pc端使用的系统 toggles意义不大 bootstrap和extjs的区别是什么呢? easyU ...

  9. NBTSTAT命令详解

    1. 具体功能    该命令用于显示本地计算机和远程计算机的基于 TCP/IP(NetBT) 协议的 NetBIOS 统计资料. NetBIOS 名称表和 NetBIOS 名称缓存. NBTSTAT  ...

  10. csu 1312 榜单(模拟题)

    http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1312 1312: 榜单 Time Limit: 1 Sec  Memory Limit: 128 ...