exe注册为service服务
if exist c:\heliy.txt goto appendinfo
exit
@echo ""
@echo ""
@echo "===============================================================" >> c:\heliy.txt
echo "Had exist file name heliy, OK,!!!" >> c:\heliy.txt
findstr /C:"Had exist" c:\heliy.txt | find /C "Had" >> c:\heliy.txt
exit
set service_name=testexe2
set service_description="heliy test this way that regesity exe of file to service item"
set exe_path=c:\\bin\\test.exe
set strt=auto
set reg_file=temp_server.reg
c:\bin\instsrv.exe %service_name% remove 2>nul
c:\bin\instsrv.exe %service_name% c:\bin\srvany.exe 2>nul
sc config %service_name% start= %strt%
sc description %service_name% "%service_description%"
echo Windows Registry Editor Version 5.00 >> c:\bin\%reg_file%
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\%service_name%\Parameters] >> c:\bin\%reg_file%
echo "Application"="%exe_path%" >> c:\bin\%reg_file%
c:\bin\%reg_file%
del /F c:\bin\%reg_file%
@pause
[-a <Account Name>] [-p <Account Password>]
-OR-
INSTSRV MyService C:\mailsrv\mailsrv.exe -a MYDOMAIN\joebob -p foo
@echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
del /f /s /q %systemroot%\SoftwareDistribution\download\*.*
del /f /s /q %systemroot%\Installer\*.msp
del /f /s /q %systemroot%\Installer\*.msi
del /f /s /q %systemroot%\Installer\*.tmp
@echo. & pause
exe注册为service服务相关推荐
- vs.net c# 安装、注册windows service服务,判断服务是否存在,是否启动
vs.net c# 安装.注册windows service服务,判断服务是否存在,是否启动 一.安装服务: private void InstallService(IDictionary state ...
- java程序服务不能启动不了_JavaService.exe注册的windows服务无法启动问题
最近开发了个java程序,打成 jar 包想要在windows后台运行,于是使用JavaService.exe进行windows服务注册,服务注册很成功,但是在启动时显示"服务无法启动&qu ...
- python打包成exe,并将exe注册到windows服务中
前段时间接到需求,需要将py脚本打包成exe,并且注册到windows服务中,保证电脑启动时服务能够自动启动,因此选择了pyinstaller进行打包,简单易操作. 安装所需要的包 pip insta ...
- linux中注册系统服务—service命令的原理通俗
能够使用service命令进行操作的,就是已经注册成为linux的系统服务了.window中也可以注册成为系统服务的办法. service命令用的次数真不少,就是比较多的关联点,用了很多次了,还是有些 ...
- bat文件注册为Windows服务与依赖关系设置
文章目录 1. 批处理文件注册为服务 1.1 应用场景 1.2 操作步骤 1.2.1 编写批处理文件; 1.2.2 借助instsrv+srvany将批处理文件注册为服务: 1.2.3 设置服务之间的 ...
- 【已解决】Windows Service服务 出现System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志。不可访问的日志: Security。
bat文件 内容为 cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\ InstallUtil.exe InstallUtil F:\Windows ...
- Windows Service服务 出现System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志
[已解决]Windows Service服务 出现System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志.不可访问的日志: Security. 青 ...
- Android Service服务保活
基于Android 10.11 实现的Service服务保活 最近公司要实现app程序不被杀死 实现持续定位,在网上看了很多个文章 也看到双进程保活,我忘了在那看到这篇文章了 下面 具体显现 创建 M ...
- 注册Tomcat到Window Service服务
注册Tomcat到Window Service服务 1.软件和环境 环境:JDK1.8 应用服务:Tomcat9.0(非安装版) 操作系统:Windows 2012 2.设置Tomcat为系统服务 w ...
最新文章
- SQL Server 的历史与发展方向
- 重磅回击!ZeniMax回击Oculus新试验
- (转载)配置apue.h
- Golang 日志框架 Zap 入坑指南
- MySQL 在 LIMIT 条件后注入
- gis如何加入emf图片_当GIS运用于建筑遗产保护
- 网吧服务器RAID 0+1硬盘阵列组建图解
- hive参数配置使用
- 选择一本适合自己的Linux系统书籍
- JVM面试必问:G1垃圾回收器
- 不停机上线服务_手机停机也能迅速交话费!微信和三大运营商联手开了“绿色通道”...
- 《南溪的python灵隐笔记》——有趣的Munch字典库
- 动态规划实战3-leetcode 55.Jump Game
- 它!5 年代替狂卷的 CNN!
- 犬心犬意 - 狗为什么会趴在地板上睡觉,不怕着凉吗?活久见
- 负数在计算机中的表示
- 祭奠一位我无比亲爱的亲人的离去
- VehicleDynamicsAndCoontrol(四) -LONGITUDINAL VEHICLE DYNAMICS
- alv 导出料号缺少最后一位
- 满分回答教你如何应对面试中项目经验这一难关
热门文章
- 设计模式——门面(外观)模式
- perl 对ENV环境变量的使用
- 在ubuntu系统荣品开发配套JDK安装
- 团队项目——ASC Master
- 云计算五种定义辨析[摘]
- 【错误记录】Android Studio 编译报错 ( A problem occurred starting process ‘command ‘ninja.exe‘ ‘ )
- 【错误记录】Kotlin 1.5.0 编译报错 ( 1.5.0 中 Float 不能直接转 Byte 类型 )
- 【Android NDK 开发】Kotlin 语言中使用 NDK ( 创建支持 Kotlin 的 NDK 项目 | Kotlin 语言中使用 NDK 要点 | 代码示例 )
- 【组合数学】排列组合 ( 多重集组合数 | 所有元素重复度大于组合数 | 多重集组合数 推导 1 分割线推导 | 多重集组合数 推导 2 不定方程非负整数解个数推导 )
- 【Netty】NIO 网络编程 聊天室案例