![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-10 21:59 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » [Closed] How to automatically search for the path of QQ and copy a program into it to run |
| Printable Version 2,562 / 15 |
| Floor1 AKC | Posted 2008-10-01 21:19 |
| 新手上路 Posts 3 Credits 10 | |
|
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) ![]() Is this the command line? Use tireless brother's 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 ] |
|
| Floor2 hackate | Posted 2008-10-01 22:08 |
| 中级用户 Posts 125 Credits 228 | |
|
@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. |
|
| Floor3 tireless | Posted 2008-10-01 22:54 |
| 银牌会员 Posts 1,122 Credits 2,025 | |
|
---------------------
[ Last edited by tireless on 2008-10-3 at 19:30 ] |
|
| Floor4 tireless | Posted 2008-10-01 23:20 |
| 银牌会员 Posts 1,122 Credits 2,025 | |
|
Strange, executing:
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 ] |
|
| Floor5 23112656 | Posted 2008-10-02 03:36 |
| 中级用户 Posts 99 Credits 220 | |
|
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 ] |
|
| Floor6 tireless | Posted 2008-10-02 11:01 |
| 银牌会员 Posts 1,122 Credits 2,025 | |
|
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 ] |
|
| Floor7 tireless | Posted 2008-10-04 12:00 |
| 银牌会员 Posts 1,122 Credits 2,025 | |
|
You can only first export the registry.
|
|
| Floor8 HAT | Posted 2008-10-04 12:42 |
| 版主 Posts 5,017 Credits 9,023 | |
|
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 |
|
| Floor9 exzzz | Posted 2008-12-05 17:26 |
| 初级用户 Posts 167 Credits 194 | |
|
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 |
|
| Floor10 5551551 | Posted 2008-12-05 19:30 |
| 初级用户 Posts 39 Credits 37 | |
Originally posted by exzzz at 2008-12-5 05:26 PM: This brother is quite skillful in using batch processing variables |
|
| Floor11 HAT | Posted 2008-12-05 20:03 |
| 版主 Posts 5,017 Credits 9,023 | |
|
What if someone didn't run QQ, heh heh.
|
|
| Floor12 ZJHJ | Posted 2008-12-05 22:14 |
| 高级用户 Posts 374 Credits 609 | |
|
@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% |
|
| Floor13 ooaf | Posted 2008-12-05 22:32 |
| 中级用户 Posts 162 Credits 313 | |
|
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.
|
|
| Floor14 ZJHJ | Posted 2008-12-05 22:44 |
| 高级用户 Posts 374 Credits 609 | |
|
Does this meet the requirements?
[ Last edited by ZJHJ on 2008-12-5 at 22:46 ] |
|
| Floor15 bluewaterx | Posted 2008-12-06 09:32 |
| 初级用户 Posts 68 Credits 132 | |
|
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 |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |