中国DOS联盟论坛

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-09-15 13:32
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS批处理 & 脚本技术(批处理室) » How to search the whole drive for QQ and open it
Printable Version  5,951 / 22
Floor1 zouzhxi Posted 2006-09-24 09:35
中级用户 Posts 177 Credits 430 From 广东深圳
Let me give an example.

I don't know where the QQ.EXE file is. There isn't a shortcut on the desktop either,
so I want to make a batch file that can find its path on the hard drive, (for example: C:\TENCENT\QQ\QQ.EXE and save this path in another file). Save this path into another batch file, then use the CALL command to call that batch file... and then exit

Can this be done?

[[i] Last edited by namejm on 2007-2-5 at 09:39 AM [/i]]
Floor2 pengfei Posted 2006-09-24 09:41
银牌会员 Posts 485 Credits 1,218 From 湖南.娄底
@echo off
for %%a in (c d) do (
for /f "tokens=*" %%i in ('dir /s /a-d /b %%a:\qq.exe') do (
echo start "" "%%i">>open.bat
)
)
call open.bat

Not sure whether this matches the OP's requirement.

[ Last edited by pengfei on 2006-9-24 at 09:43 ]
Floor3 3742668 Posted 2006-09-24 09:48
荣誉版主 Posts 718 Credits 2,013

This can probably meet your requirement, though it isn't the optimal solution.
Floor4 zouzhxi Posted 2006-09-24 09:58
中级用户 Posts 177 Credits 430 From 广东深圳
That does work... but there are two problems

The generated file looks like this:
start "" "c:\Tencent\QQ\QQ.exe"
But what I want is only c:\Tencent\QQ\QQ.exe

And also, after QQ is opened, can the generated file be deleted...
Floor5 pengfei Posted 2006-09-24 10:00
银牌会员 Posts 485 Credits 1,218 From 湖南.娄底
@echo off
for %%a in (c d) do (
for /f "tokens=*" %%i in ('dir /s /a-d /b %%a:\qq.exe') do (
start "" "%%i"
)
)


I don't know which drive the OP installed QQ on, so by default it searches drives C and D. If you want to improve efficiency, just enter the drive letter where QQ is installed.
Floor6 zouzhxi Posted 2006-09-25 01:06
中级用户 Posts 177 Credits 430 From 广东深圳
It's my fault. I described it wrong.

It should be like this.
I just don't know where that file is. For example, where is the LANDTIMER.INI file? I want to find it and get a few lines of text information from inside the file.
The file contents are written like this

[option]
TYPE=0
IP=192.168.151.153
PROXY=*.COM
……
and so on
I just want to write them separately into different files. The filenames just need to match the letters before the equals sign...
Floor7 vkill Posted 2006-09-25 01:13
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
Once you've already found the file path, then just do for /f %%i in (‘file path’) do (echo ............) and it'll be fine~
Floor8 namejm Posted 2006-09-25 02:39
荣誉版主 Posts 1,737 Credits 5,226 From 成都
  Try the code below and see whether it works (administrator privileges required, efficiency isn't very high):


[ Last edited by namejm on 2006-9-25 at 02:41 ]
Floor9 lxmxn Posted 2006-09-25 03:16
版主 Posts 4,938 Credits 11,386
The moderator's skillful wmic statements are really admirable``
I admit defeat``
Floor10 3742668 Posted 2006-09-25 03:16
荣誉版主 Posts 718 Credits 2,013

Only tested in the case where there is only one landtimer.ini on the whole drive; by default it processes them all.
Floor11 electronixtar Posted 2006-09-25 03:23
铂金会员 Posts 2,672 Credits 7,493
Just check the registry, there will definitely be a QQ path there
Floor12 mobo Posted 2006-09-25 03:33
初级用户 Posts 30 Credits 73
Floor13 zouzhxi Posted 2006-09-25 05:46
中级用户 Posts 177 Credits 430 From 广东深圳
Thanks. Your answers were wonderful....
The problem has already been solved,,,
Floor14 my3439955 Posted 2007-04-20 23:55
中级用户 Posts 99 Credits 272
HKLM\SOFTWARE\Tencent\QQ\Install
is the QQ installation path, if it exists
Floor15 zhoushijay Posted 2007-04-21 03:01
高级用户 Posts 375 Credits 845
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023