|
AKC
新手上路

积分 10
发帖 3
注册 2008-10-1
状态 离线
|
『楼 主』:
[已结]怎么自动搜索QQ的路径并复制一个程序进去运行
使用 LLM 解释/回答一下
小弟想做个随身的U盘QQ登陆程序,主程序好了,可我不知道怎么自动复制到别人电脑的QQ目录下运行,求版主大大指教啊!
(要设置QQ的变量吗?)
谢谢各位的帮助哈,不过怎么实现把程序考进QQ的目录呢?(我的意思是能否启动一次BAT程序就实现将文件拷贝进QQ的目录里并运行)
<img src="images/smilies/face-raspberry.png" align="absmiddle" border="0">
这命令行不? copy e:\1.txt %QQPath%
用tireless兄的 echo off
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ tmp.orz
more tmp.orz>tmp2.orz
for /f "skip=3 delims== tokens=2" %%o in (tmp2.orz) do set qqpath=%%o
copy e:\1.txt %qqpath:\\=\%
del tmp*.orz
pause
显示文件名、目录或卷标语法不正确
Last edited by HAT on 2008-12-5 at 22:52 ]
Little brother wants to make a portable U-disk QQ login program. The main program is done, but I don't know how to automatically copy it to the QQ directory of someone else's computer to run. Please, senior moderator, give me some advice!
(Do I need to set the QQ variable?)
Thank you all for your help, but how to realize copying the program into the QQ directory? (I mean, can starting a BAT program once realize copying the file into the QQ directory and running it)
:P
Is this the command line?
copy e:\1.txt %QQPath%
Use tireless brother's
echo off
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ tmp.orz
more tmp.orz>tmp2.orz
for /f "skip=3 delims== tokens=2" %%o in (tmp2.orz) do set qqpath=%%o
copy e:\1.txt %qqpath:\\=\%
del tmp*.orz
pause
It shows that the syntax of file name, directory or volume label is incorrect
Last edited by HAT on 2008-12-5 at 22:52 ]
|
|
2008-10-1 21:19 |
|
|
hackate
中级用户
  
积分 228
发帖 125
注册 2008-8-25
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
@echo off
for /f "skip=4 tokens=1,2 delims=:" %%a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ /v Install') do (
set QQPathL=%%a
set QQPathR=%%b
)
set QQPath=%QQPathL:~-1%:%QQPathR%
echo %QQPath%
pause
这个代码是获取QQ的安装目录啊。
@echo off
for /f "skip=4 tokens=1,2 delims=:" %%a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ /v Install') do (
set QQPathL=%%a
set QQPathR=%%b
)
set QQPath=%QQPathL:~-1%:%QQPathR%
echo %QQPath%
pause
This code is to get the installation directory of QQ.
|
|
2008-10-1 22:08 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
---------------------
Last edited by tireless on 2008-10-3 at 19:30 ]
---------------------
Last edited by tireless on 2008-10-3 at 19:30 ]
|
|
2008-10-1 22:54 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
奇怪,执行:
for /f "skip=4 tokens=2*" %a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ /v Install') do @echo %b
得到的结果是 D:\Program Files\深度 DEEPQ
而正确的路径是 D:\Program Files\深度 DEEPQQ\
为什么?
Last edited by tireless on 2008-10-1 at 23:27 ]
Strange, executing:
for /f "skip=4 tokens=2*" %a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ /v Install') do @echo %b
The result obtained is D:\Program Files\深度 DEEPQ
And the correct path is D:\Program Files\深度 DEEPQQ\
Why?
Last edited by tireless on 2008-10-1 at 23:27 ]
|
|
2008-10-1 23:20 |
|
|
23112656
中级用户
  
积分 220
发帖 99
注册 2008-6-26
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
for /f "skip=4 tokens=2*" %a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ /v Install') do @echo %b
少了SP3补丁.装上就没问题了.以前我也遇到过.
reg对中文识别好像不健全.是HAT大哥告诉我的.
Last edited by 23112656 on 2008-10-2 at 03:39 ]
for /f "skip=4 tokens=2*" %a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ /v Install') do @echo %b
Missing SP3 patch. It will be okay after installing. I also encountered this before.
Reg seems to have incomplete support for Chinese. This was told to me by Brother HAT.
Last edited by 23112656 on 2008-10-2 at 03:39 ]
|
|
2008-10-2 03:36 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
在命令提示符下,reg query 显示的结果是完整的。
而将 reg query 的结果输出到文件就会少字符。。
Last edited by tireless on 2008-10-4 at 12:30 ]
Under the command prompt, the results displayed by reg query are complete.
But when outputting the results of reg query to a file, there will be fewer characters.
Last edited by tireless on 2008-10-4 at 12:30 ]
|
|
2008-10-2 11:01 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
只能先把注册表导出。
@echo off
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ qq_.tmp
for /f "delims== tokens=2" %%o in ('more qq_.tmp^|find /i "install"') do set qqpath=%%o
COPY E:\1.TXT %qqpath:\\=\%
del qq_.tmp
You can only first export the registry.
@echo off
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ qq_.tmp
for /f "delims== tokens=2" %%o in ('more qq_.tmp^|find /i "install"') do set qqpath=%%o
COPY E:\1.TXT %qqpath:\\=\%
del qq_.tmp
此帖被 +2 点积分 点击查看详情 评分人:【 HAT 】 | 分数: +2 | 时间:2008-12-5 22:52 |
|
|
|
2008-10-4 12:00 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
XP SP2中文版的reg.exe有bug,当reg query遇到中文字符时可能会"吃字符",详见 http://www.cn-dos.net/forum/viewthread.php?tid=22202
解决方案如下:
1. 用XP SP2以上的版本的操作系统(XP SP3/2003/Vista等,XP SP2英文版也可)中的reg.exe来替换XP SP2中文版的reg.exe
2. 调用VBS读注册表,并把返回结果传递给BAT
3. 用reg export把注册表项导出到一个临时文件,再搜索该文件,值得注意的是reg export导出的文件是Unicode编码格式,可以使用type命令进行处理
There is a bug in the reg.exe of the Chinese version of XP SP2. When reg query encounters Chinese characters, it may "eat characters". For details, see http://www.cn-dos.net/forum/viewthread.php?tid=22202
The solutions are as follows:
1. Replace the reg.exe of the Chinese version of XP SP2 with reg.exe from operating systems with versions higher than XP SP2 (such as XP SP3/2003/Vista, etc., the English version of XP SP2 is also acceptable)
2. Call VBS to read the registry and pass the returned result to BAT
3. Use reg export to export the registry key to a temporary file, and then search the file. It should be noted that the file exported by reg export is in Unicode encoding format, and the type command can be used for processing
|

 |
|
2008-10-4 12:42 |
|
|
exzzz
初级用户
  游手好闲 + 无所事事 ..
积分 194
发帖 167
注册 2007-4-30
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
不如用下面这个咯,说不定你有好几个QQ呢,也或者是用的绿色版的没有注册表路径呢?
那就开着QQ运行下面的批处理吧。
echo off
title 这个程序可显示内存中正运行的程序“QQ.EXE”的路径
cls
for /f "delims==" %%a in ('wmic process where caption^="qq.exe" get CommandLine^|find "QQ.exe"') do set qqpath=%%a
set qqpath=%qqpath:~1,-11%
echo %qqpath%
pause
set qqpath
Why not use the following one? Maybe you have several QQs, or you are using a green version without a registry path? Then run the following batch file while QQ is running.
echo off
title This program can display the path of the program "QQ.EXE" running in memory
cls
for /f "delims==" %%a in ('wmic process where caption^="qq.exe" get CommandLine^|find "QQ.exe"') do set qqpath=%%a
set qqpath=%qqpath:~1,-11%
echo %qqpath%
pause
set qqpath
|
|
2008-12-5 17:26 |
|
|
5551551
初级用户
 
积分 37
发帖 39
注册 2007-12-7
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by exzzz at 2008-12-5 05:26 PM:
不如用下面这个咯,说不定你有好几个QQ呢,也或者是用的绿色版的没有注册表路径呢?
那就开着QQ运行下面的批处理吧。
echo off
title 这个程序可 ...
这位兄弟批处理变量用得活灵活现的
Originally posted by exzzz at 2008-12-5 05:26 PM:
Why not use the following one? Maybe you have several QQs, or you are using a portable version without a registry path?
Then run the following batch script while QQ is running.
echo off
title This program can ...
This brother is quite skillful in using batch processing variables
|
|
2008-12-5 19:30 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 11 楼』:
Re 9楼
使用 LLM 解释/回答一下
如果人家没有运行QQ咋办呢,呵呵。
What if someone didn't run QQ, heh heh.
|

 |
|
2008-12-5 20:03 |
|
|
ZJHJ
高级用户
   
积分 609
发帖 374
注册 2006-8-2
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
@echo off
for %%f in (C D E F G H I J K L M N O P) do (
for /f %%i in ('dir %%f:\qq.exe /a /b /s') do set qq=%%i
)
start %qq%
@echo off
for %%f in (C D E F G H I J K L M N O P) do (
for /f %%i in ('dir %%f:\qq.exe /a /b /s') do set qq=%%i
)
start %qq%
|
|
2008-12-5 22:14 |
|
|
ooaf
中级用户
  
积分 313
发帖 162
注册 2007-4-2
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
彩虹QQ补丁 绿色版 好像不用运行qq 也能找到qq 的路径, 是最后一次运行qq 的路径, 不知咋原理?
Rainbow QQ patch green version, it seems that you don't need to run QQ to find the path of QQ, which is the path of the last run of QQ. I don't know the principle.
|
|
2008-12-5 22:32 |
|
|
ZJHJ
高级用户
   
积分 609
发帖 374
注册 2006-8-2
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
这个符合要求不?
@echo off
for %%f in (C D E F G H I J K L M N O P) do (
for /f %%i in ('dir %%f:\qq.exe /a /b /s') do @echo %%i>qq.txt
)
for /f "delims=" %%a in ('findstr /n .* qq.txt') do (
set "var=%%a"
setlocal enabledelayedexpansion
set var=!var:*:=!
if not "!var!"=="" set var=!var:qq.exe=!
echo.!var!>qqdz.txt
endlocal
)
del qq.txt
for /f %%i in (qqdz.txt) do set qqdz=%%i
copy e:\1.txt %qqdz%
del qqdz.txt
start %qqdz%\1.txt
Last edited by ZJHJ on 2008-12-5 at 22:46 ]
Does this meet the requirements?
@echo off
for %%f in (C D E F G H I J K L M N O P) do (
for /f %%i in ('dir %%f:\qq.exe /a /b /s') do @echo %%i>qq.txt
)
for /f "delims=" %%a in ('findstr /n .* qq.txt') do (
set "var=%%a"
setlocal enabledelayedexpansion
set var=!var:*:=!
if not "!var!"=="" set var=!var:qq.exe=!
echo.!var!>qqdz.txt
endlocal
)
del qq.txt
for /f %%i in (qqdz.txt) do set qqdz=%%i
copy e:\1.txt %qqdz%
del qqdz.txt
start %qqdz%\1.txt
Last edited by ZJHJ on 2008-12-5 at 22:46 ]
|
|
2008-12-5 22:44 |
|
|
bluewaterx
初级用户
 
积分 132
发帖 68
注册 2008-7-29
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
绿色版的QQ也可以识别,只要运行一次,注册表中就有路径存在
@echo off
setlocal enabledelayedexpansion
for /f "skip=4 delims=" %%i in ('reg query HKEY_CLASSES_ROOT\CLSID\{2D616D8F-F1BA-43A1-BEF0-E2A82A0FBD56}\LocalServer32 /ve 2^>nul') do set qqPath=%%i&set qqPath=!qqPath:~14!&set tmpVar=0&call :subPathChange "!qqPath!"
echo !qqPath!&pause&exit
:subPathChange
if !tmpVar! equ 0 set tmpVar=1&set qqPath=%~fs1&call :subPathChange "!qqPath!"
set qqPath=%~dp1
goto :eof
Green version of QQ can also be recognized. As long as it runs once, the path will exist in the registry.
@echo off
setlocal enabledelayedexpansion
for /f "skip=4 delims=" %%i in ('reg query HKEY_CLASSES_ROOT\CLSID\{2D616D8F-F1BA-43A1-BEF0-E2A82A0FBD56}\LocalServer32 /ve 2^>nul') do set qqPath=%%i&set qqPath=!qqPath:~14!&set tmpVar=0&call :subPathChange "!qqPath!"
echo !qqPath!&pause&exit
:subPathChange
if !tmpVar! equ 0 set tmpVar=1&set qqPath=%~fs1&call :subPathChange "!qqPath!"
set qqPath=%~dp1
goto :eof
|
|
2008-12-6 09:32 |
|