Board logo

标题: 有关关闭qq程序的问题!! [打印本页]

作者: water0     时间: 2009-12-31 23:10    标题: 有关关闭qq程序的问题!!

@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
tasklist |find /i "QQ.exe"
if %errorlevel%==0 (goto killit) else (goto next)
:killit
taskkill /f /im QQ.exe
:next
ping -n 3 127.t >nul 2>nul
goto begin

从网上找的,

mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit 这句话据说是实现隐藏cmd窗口,为何在我的电脑上实现不了啊!!!
作者: moniuming     时间: 2010-1-1 02:03
可能是文件名有空格吧,把"%~nx0 h"改成"%~fs0 h"试试???
作者: water0     时间: 2010-1-1 11:05
竟然可以了,能说一下原理吗!!!
作者: HAT     时间: 2010-1-1 14:09    标题: Re 3楼

你能说一下%~nx0和%~fs0的区别吗?