就是不需要在bat里加入QQ绝对路径的那种批处理
用搜索...那要很长时间,约..10分钟...硬盘文件多的可能要半小时....
别用搜索吧...
echo dim program >a.vbs
echo program="QQ路径\QQ.exe">>a.vbs
echo set Wshell=CreateObject("Wscript.Shell") >>a.vbs
echo set oexec=Wshell.Exec(program) >>a.vbs
echo wscript.Sleep 2000 >>a.vbs
echo Wshell.AppActivate "QQTang" >>a.vbs
echo Wshell.SendKeys "+{TAB}" >>a.vbs
echo Wshell.SendKeys "QQ账号" >>a.vbs
echo wscript.Sleep 1000 >>a.vbs
echo Wshell.SendKeys "{TAB}" >>a.vbs
echo Wshell.SendKeys "QQ密码" >>a.vbs
echo wscript.Sleep 1000 >>a.vbs
echo Wshell.SendKeys "{ENTER}">>a.vbs
a.vbs
del a.vbs
exit
如果你要搜索,就配合1345431的代码吧:
@echo off
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && (
for /f "tokens=*" %%j in ('dir /a-d /b /s !drive!\qq.exe 2^>nul') do if not "%%j"=="" set "qq=%%j" && goto s
)
:s
echo dim program >a.vbs
echo program="%qq%">>a.vbs
echo set Wshell=CreateObject("Wscript.Shell") >>a.vbs
echo set oexec=Wshell.Exec(program) >>a.vbs
echo wscript.Sleep 2000 >>a.vbs
echo Wshell.AppActivate "QQTang" >>a.vbs
echo Wshell.SendKeys "+{TAB}" >>a.vbs
echo Wshell.SendKeys "QQ账号" >>a.vbs
echo wscript.Sleep 1000 >>a.vbs
echo Wshell.SendKeys "{TAB}" >>a.vbs
echo Wshell.SendKeys "QQ密码" >>a.vbs
echo wscript.Sleep 1000 >>a.vbs
echo Wshell.SendKeys "{ENTER}">>a.vbs
a.vbs
del a.vbs
exit
别用搜索吧...
echo dim program >a.vbs
echo program="QQ路径\QQ.exe">>a.vbs
echo set Wshell=CreateObject("Wscript.Shell") >>a.vbs
echo set oexec=Wshell.Exec(program) >>a.vbs
echo wscript.Sleep 2000 >>a.vbs
echo Wshell.AppActivate "QQTang" >>a.vbs
echo Wshell.SendKeys "+{TAB}" >>a.vbs
echo Wshell.SendKeys "QQ账号" >>a.vbs
echo wscript.Sleep 1000 >>a.vbs
echo Wshell.SendKeys "{TAB}" >>a.vbs
echo Wshell.SendKeys "QQ密码" >>a.vbs
echo wscript.Sleep 1000 >>a.vbs
echo Wshell.SendKeys "{ENTER}">>a.vbs
a.vbs
del a.vbs
exit
如果你要搜索,就配合1345431的代码吧:
@echo off
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && (
for /f "tokens=*" %%j in ('dir /a-d /b /s !drive!\qq.exe 2^>nul') do if not "%%j"=="" set "qq=%%j" && goto s
)
:s
echo dim program >a.vbs
echo program="%qq%">>a.vbs
echo set Wshell=CreateObject("Wscript.Shell") >>a.vbs
echo set oexec=Wshell.Exec(program) >>a.vbs
echo wscript.Sleep 2000 >>a.vbs
echo Wshell.AppActivate "QQTang" >>a.vbs
echo Wshell.SendKeys "+{TAB}" >>a.vbs
echo Wshell.SendKeys "QQ账号" >>a.vbs
echo wscript.Sleep 1000 >>a.vbs
echo Wshell.SendKeys "{TAB}" >>a.vbs
echo Wshell.SendKeys "QQ密码" >>a.vbs
echo wscript.Sleep 1000 >>a.vbs
echo Wshell.SendKeys "{ENTER}">>a.vbs
a.vbs
del a.vbs
exit
温馨提示:答案为网友推荐,仅供参考
第1个回答 2009-09-05
@echo off
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && (
for /f "tokens=*" %%j in ('dir /a-d /b /s !drive!\qq.exe 2^>nul') do if not "%%j"=="" start "" "%%j" && exit
)
)
你还可以把qq.exe改成请它文件名
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && (
for /f "tokens=*" %%j in ('dir /a-d /b /s !drive!\qq.exe 2^>nul') do if not "%%j"=="" start "" "%%j" && exit
)
)
你还可以把qq.exe改成请它文件名