China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-02 22:53
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Why can't QQ automatically log in via the command line? View 2,421 Replies 11
Original Poster Posted 2007-08-30 20:54 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
```
start qq.exe /start qquin:QQ number pwdhash:Hashed password /stat:40
```
After running the command, the QQ login box pops up, but automatic login is not possible.
I originally thought it was a problem with the QQ version, so I uninstalled the original QQ 2006 Coral虫 and downloaded QQ 2007 BETA 4 from the Tencent official website, but the problem remains.
Hope an expert can give guidance.

=========================================Summary=========================================

Principle and usage method:

```
start "" "C:\Program Files\Tencent\QQ\qq.exe" /start QQUIN:843875648 PWDHASH:4Z1c1a8DeNoF9j+JHHRnrw== /stat:40
```

10: Online login
40: Invisible login
41: Online login
QQUIN and PWDHASH must use uppercase letters

Principle: When QQ transmits the password, it first performs an MD5 encryption, then a BASE64 transformation, so that the normal text information can be obtained for network transmission. Find an online MD5 query website (such as http://www.xmd5.org/), enter the plaintext of the QQ password, convert to get the result of MD5 encryption, then find an online BASE64 query website (such as http://www.waishi.net/ip/tools/base64.htm), enter the just-obtained result of MD5 encryption, and convert to get the HASH code.

Using the SendKeys method of VBS to automatically log in, because it cannot guarantee to obtain the correct form, there is a risk, so it is not considered.


After testing, currently, this method cannot be used to log in to the latest QQ 2009 Preview 4. It may be that the new version of QQ has not opened this command interface yet, and we can only look forward to the 2009 official version.

Several methods to automatically obtain the QQ path: read the registry, search the entire disk, obtain process information, etc.:

```
@echo off
rem Use WMIC to obtain the QQ path in the process information
for /f "tokens=2 delims==" %%a in ('wmic process where "name='qq.exe'" get executablepath /value') do (
set QQPath=%%a
)
echo %QQPath%
pause
```

```
@echo off
rem Use WMIC to search the entire disk to obtain the QQ path
for /f "skip=1 delims=" %%a in ('wmic datafile where "filename='qq' and extension='exe'" get name') do (
set QQPath=%%a
)
echo %QQPath%
pause
```

```
@echo off
rem Use the reg command to read the registry to obtain the QQ path
for /f "tokens=2*" %%a in ('reg query HKEY_LOCAL_MACHINE\Software\Tencent\QQ /v Install^|findstr "Install"') do (
set QQPath=%%b
)
echo %QQPath%
pause
```

```
@echo off
rem Use the reg export command to export the registry key and then search to obtain the QQ path to avoid the problem that reg query may eat Chinese characters
reg export "HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ" "%temp%\qq.txt">nul
for /f "tokens=2 delims==" %%a in ('type "%temp%\qq.txt"^|findstr /i "Install"') do (
set QQPath=%%~a
)
set QQPath=%QQPath:\\=\%
echo %QQPath%
pause
```

```
@echo off
rem Call VBS to read the registry to obtain the QQ path
>"%temp%\my.vbs" echo Set WshShell = WScript.CreateObject("WScript.Shell")
>>"%temp%\my.vbs" echo WScript.Echo WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ\Install")
for /f "delims=" %%a in ('cscript /nologo "%temp%\my.vbs"') do (
set QQPath=%%a
)
echo %QQPath%
pause
```

```
@echo off
rem Search the entire disk to obtain the QQ path
set fName=qq.exe
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%a:\nul (
pushd %%a:\
for /r %%b in (*.exe) do (
if /i "%%~nxb" equ "%fName%" (
set fPath=%%b
goto :show
)
)
popd
)
)
:show
echo %fPath%
pause
```

Encrypt the QQ password:

QQ self-service login: How to perform Base64 on the 16 - bit MD5 value itself
http://www.cn-dos.net/forum/viewthread.php?tid=27000

MD5 encryption.hta
http://www.cn-dos.net/forum/viewthread.php?tid=36823

MD5.vbs
http://www.cn-dos.net/forum/viewthread.php?tid=27000&page=2#pid303952

PWDHASH.vbs
http://www.cn-dos.net/forum/viewthread.php?tid=27000&page=2#pid303953

JavaScript source code for QQ password to generate PWDHASH
http://www.cn-dos.net/forum/viewthread.php?tid=29795&page=2#pid194595

[ Last edited by HAT on 2009-1-5 at 23:13 ]
Floor 2 Posted 2007-08-30 21:23 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
4Z1c1a8DeNoF9j+JHHRnrwAA==
Floor 3 Posted 2007-08-30 21:30 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Brother slore, it still doesn't work.
Does it work on your computer?
Also, can you share your encryption method?
Floor 4 Posted 2007-08-30 21:53 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
I don't use this method for automatic login...

Yours is correct, need to add AA==
Try using uppercase...
QQUIN: PWDHASH:
Encryption is all MD5+BASE64...
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
HAT +4 2007-08-30 22:23
Floor 5 Posted 2007-08-30 22:23 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
After testing, logging in is normal after capitalizing. It's such an issue, sweat. Points still need to be added.
Floor 6 Posted 2007-09-01 17:14 ·  中国 上海 崇明区 电信
新手上路
Credits 6
Posts 3
Joined 2006-09-17 22:15
19-year member
UID 62883
Status Offline
Learned!
Floor 7 Posted 2008-03-27 15:31 ·  中国 湖北 武汉 电信
初级用户
Credits 22
Posts 9
Joined 2008-03-23 21:27
18-year member
UID 113810
Gender Male
Status Offline
Oh, I see! That's why it didn't work!
Floor 8 Posted 2008-04-17 21:21 ·  中国 江苏 苏州 电信
中级用户
★★
Credits 238
Posts 98
Joined 2007-04-10 07:50
19-year member
UID 84593
Gender Male
From 陕西
Status Offline
Boss, can you write a detailed one for us newcomers to refer to?
I've tried many times and can't log in normally.
Thanks!
一切皆有可能!我行!我能!
Floor 9 Posted 2008-04-17 21:55 ·  中国 浙江 嘉兴 平湖市 电信
初级用户
★★
Credits 157
Posts 67
Joined 2007-05-13 11:03
19-year member
UID 88378
Gender Male
Status Offline
QQ2008 cannot capture the password input box with this trick
Floor 10 Posted 2008-12-12 00:31 ·  中国 江苏 苏州 电信
初级用户
★★
Credits 161
Posts 87
Joined 2008-05-25 17:25
18-year member
UID 119673
Gender Male
Status Offline
There's nothing wrong. I used your command and logged in to your QQ, just changed the path to my own.
Floor 11 Posted 2009-03-14 12:58 ·  中国 山西 忻州 联通
初级用户
★★
Credits 87
Posts 63
Joined 2008-08-23 11:28
17-year member
UID 123947
Gender Male
Status Offline
Log in to QQ, go to System Menu -> Friends and Profile -> Update Friends. Then, through cmd -> wmic -> process, you can view the process to see the password.
Floor 12 Posted 2009-03-18 08:40 ·  中国 江苏 苏州 电信
新手上路
Credits 9
Posts 6
Joined 2009-03-17 10:49
17-year member
UID 141557
Gender Male
Status Offline
Learned, interesting question
Forum Jump: