赞
踩
一、windows 开机自启
把需要启动的可执行文件或快捷方式放在
C:\users\用户名\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
或
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
二、后台执行
(1)使用bat 批处理 脚本实现
- @echo off
- if "%1" == "h" goto begin
- start mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
- :begin
-
- ##前四行是隐藏cmd窗口必不可少代码##
- ##下一句引号中内容【随便写,其语法相当于描述说明】
- echo "xxx后台运行脚本"
-
- ##下一句 cd 后面跟exe程序的绝对路径 /d 参数使得当前终端路径切换有效
- cd /d D:\program files\ssl\
-
- ##下一句 start /b 后跟exe程序 【全名】
- start /b ssl.exe
(2)使用vbs脚本实现 保证vbs脚本与可执行文件在同一文件夹中 或 可执行命令在环境变量中
CreateObject("WScript.Shell").Run “test.exe",0,FALSE
test.exe 为可执行文件的完全名称
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。