Make your application starts automatically(让你的软件自动启动)

    Each time, we need to open some software in the open computer, especially at work, which often cost you some time. Now I teach people to use BAT command to help us solve this problem, allowing your colleagues envy you.
    First, we need to create a text file on the desktop, to change its name to "start.bat", then you'll find its icon has changed.
    Then right-click the file, select "Edit", or use the Notepad tool to open it.
    In which the input:
==============================================
<span style="font-size:14px;">@echo off
title open work environment
echo Trying to open work environment, if it fails, use Run as administrator ...
start "" "D: \ Program Files (x86) \ Tencent \ QQ \ Bin \ QQScLauncher.exe"
ping / n 3 127.0.0.1> nul
start "" "D: \ Program Files (x86) \ Tencent \ QQ \ Bin \ QQScLauncher.exe"
echo start command has been issued, exiting ...
eixt</span>
==============================================
    Finally, save it and exit
    Note that you will need to replace the path above the path they need to start the application, whenever add a time, do not forget to add "ping / n 3 127.0.0.1> nul" in front of it, because it allows you to the cpu pressure balance.
    Well,I don't have other anything to tell you, hurry to go try it!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的nginx自动启动脚本,可以在/etc/init.d/nginx文件中进行保存: ``` #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 proxy server # processname: nginx # config: /etc/nginx/nginx.conf # config: /etc/sysconfig/nginx # pidfile: /var/run/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx="/usr/sbin/nginx" prog=$(basename $nginx) NGINX_CONF_FILE="/etc/nginx/nginx.conf" [ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx lockfile=/var/lock/subsys/nginx start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $prog: " killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { configtest || return $? stop sleep 1 start } reload() { configtest || return $? echo -n $"Reloading $prog: " killproc $nginx -HUP RETVAL=$? echo } configtest() { $nginx -t -c $NGINX_CONF_FILE } rh_status() { status $prog } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart) $1 ;; reload) $1 ;; status) rh_status ;; configtest) $1 ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|configtest}" exit 2 esac ``` 保存后,需要给该文件添加可执行权限: ``` chmod +x /etc/init.d/nginx ``` 然后可以使用以下命令来启动、停止、重启、重新加载、检查状态或测试配置: ``` service nginx start service nginx stop service nginx restart service nginx reload service nginx status service nginx configtest ``` 此脚本适用于CentOS/Redhat等基于SysV的Linux发行版。对于其他发行版,可能需要稍作修改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值