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. thymeleaf 模板引擎

    1.创建模板解析器 Create Template Resolver  用来加载模板 // create template resolver //创建模板解析器可以用Servlet上下文模板解析器Se ...

  2. [Linux]学习笔记(1)

    说到Linux就不得不提UNIX,因为Linux是从UNIX系统发展来的,两系统极为相似,可以在UNIX操作系统上使用的功能都可以在Linux上使用,只可能有少许的差异: UNIX系统中所有的东西都是 ...

  3. linux内核编译,内核参数修改

    核心(kernel):/boot/vmlinuz-version version 带发行包版本,本地版本内核模块(kernel object): /lib/modules/version/ 内核设计: ...

  4. HttpClient使用笔记

    使用版本为4.5.1 常用API: 1.获取网页内容:InputStream in = response.getEntity().getContent() 2.获取状态码:response.getSt ...

  5. 跟着PHP100第一季学写一个CMS(1-10)

    笔记: 这次用的方法是先跟着视频做一遍,隔一天或半天后独立再做一遍,能发现真正不会的地方记录下来. CMS0.1界面布局1.问题:分两个css来实现时basic.css+index.php出现定位不正 ...

  6. WPF 中 TreeListView 的使用

    前段时间在项目开发中需要用 TreeListView 的功能,于是在网上狂搜一通,倒也找到了几个小例子,但还是满足不了我简单的要求,由于时间紧也只能折中凑合着用了.最近时间比较充裕,把其中的例子整理一 ...

  7. mac 下 配置 xhprof

    1: 下载 安装 xhprof wget http://pecl.php.net/get/xhprof-0.9.3.tgztar zxf xhprof-0.9.3.tgzcd xhprof-0.9.3 ...

  8. Mysql 如何删除数据表中的重复数据!

    1.使用distinct查询所有不重复的记录 2.创建数据表相同结构的临时表,将第一步的数据复制进去 create temporary table if not exists student_temp ...

  9. 为cocos2d-x实现安卓输入框。非全屏,无dialog,绑定到lua

    cocos2d-x官方自带的输入框,简直惨不忍睹,在ios还好,在安卓简直了..用过的都知道... 所以为了用户体验,我们自己搞一个吧.输入框这种东西比较特殊,不像按钮.列表框之类的很容易实现,因为涉 ...

  10. Create CSS3 Buttons Compatible with All Browsers

    Create CSS3 Buttons Compatible with All Browsers http://www.ourtuts.com/create-css3-buttons-compatib ...