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-08-02 10:20
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Where can I find VBS tutorials? Does anyone have any? Can you help me convert this batch script to VBS? View 2,607 Replies 12
Original Poster Posted 2006-10-30 02:40 ·  中国 广东 河源 电信
中级用户
★★
Credits 266
Posts 98
Joined 2006-04-21 20:29
20-year member
UID 54223
Gender Male
Status Offline
Originally, it was to save as killqq.bat
@echo off
start h:\wenqq\qq.exe
ping 127.0.0.1 -n 5
taskkill /f /t /im TIMPlatform.exe

This is saved as .vbs found. The startup batch has no black screen.
DIM objShell
set objShell=wscript.createObject("wscript.shell")
iReturn=objShell.Run("cmd.exe /C killqq.bat", 0, TRUE)

When starting, it will first call cmd ping taskkill these commands.
@echo off
start h:\wenqq\qq.exe
ping 127.0.0.1 -n 5 ////Can this be replaced by something else? What command in VBS can be used?
taskkill /f /t /im TIMPlatform.exe Kill this. What in VBS?
.. Ask for a way to kill the timplatform.exe process with VBS. .. Thank you.
timplatform.exe can also be deleted in QQ. But chat rooms and these can't enter `~
Floor 2 Posted 2006-10-30 03:53 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  May I ask the original poster, why do you want to kill the TIMPlatform.exe process? Killing it might cause QQ not to work properly...

  In VBS, for delay, you can use "Wscript.Sleep 1000" to delay for one second. As for killing the process, I don't know about VBS. I don't know if it calls CMD commands.
Floor 3 Posted 2006-10-30 04:05 ·  中国 广东 河源 电信
中级用户
★★
Credits 266
Posts 98
Joined 2006-04-21 20:29
20-year member
UID 54223
Gender Male
Status Offline
Because it's just chatting, that process is useless... It takes up memory in vain. So kill it...
Floor 4 Posted 2006-10-30 04:44 ·  中国 浙江 温州 电信
中级用户
★★
Credits 458
Posts 196
Joined 2006-10-05 12:04
19-year member
UID 64614
Status Offline
Ending processes can use VBS + WMI without calling cmd
Floor 5 Posted 2006-10-30 22:50 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 6 Posted 2006-10-31 01:45 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline

createobject("wscript.shell").run "cmd.exe",1 'Change the last 1 to 0 to run in the background
wscript.sleep 2000 'Delay for 2 seconds, can be modified by yourself
str = "TIMPlatform.exe" 'Process name to end
for each x in getobject("winmgmts:\\.\root\cimv2:win32_process").instances_
if ucase(x.name) = ucase(str) then x.terminate
next

Code not tested..
Floor 7 Posted 2006-10-31 02:22 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
I think it's better like this:
@echo off
del h:\wenqq\TIMPlatform.exe
start h:\wenqq\qq.exe
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +2 2006-10-31 02:40
Floor 8 Posted 2006-11-03 05:28 ·  中国 广东 河源 电信
中级用户
★★
Credits 266
Posts 98
Joined 2006-04-21 20:29
20-year member
UID 54223
Gender Male
Status Offline
TIMPlatform.exe
When just chatting normally, this is not useful.. Sometimes you might go to the chat room to chat, and then you need this...
Floor 9 Posted 2006-11-03 08:33 ·  中国 广东 东莞 电信
初级用户
★★
Credits 118
Posts 66
Joined 2005-10-21 03:27
20-year member
UID 43827
Status Offline
The moderator didn't consider the significance of killing TIMPlatorm.exe! The reason is that in places like internet cafes, sometimes TIMPlatorm.exe may conflict with other software! And TIMPlatorm.exe is resident in memory! If you delete it, some users need it and it won't work! So killing it is the best!

So
createobject("wscript.shell").run "cmd.exe",1 'Change the last 1 to 0 to run in the background
wscript.sleep 2000 'Delay for 2 seconds, can be modified by yourself
str = "TIMPlatform.exe" 'The process name to end
for each x in getobject("winmgmts:\\.\root\cimv2:win32_process").instances_
if ucase(x.name) = ucase(str) then x.terminate
next

This is still pretty good!
Floor 10 Posted 2006-11-03 09:09 ·  中国 广东 河源 电信
中级用户
★★
Credits 266
Posts 98
Joined 2006-04-21 20:29
20-year member
UID 54223
Gender Male
Status Offline
Originally posted by 3742668 at 2006-10-31 01:45:

createobject("wscript.shell").run "cmd.exe",1 ' Change the last 1 to 0 to run in the background
wscript.sleep 2000 ' Delay for 2 seconds, can be modified by yourself
str = "TIMPlatform.exe&quo ...


Don't understand the following ending command~~
Floor 11 Posted 2006-11-03 10:40 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Originally posted by zerostudy at 2006-11-3 09:09:

Can't understand the following ending command~~


  It's not a command, but a script written in VBS. Just run it.
Floor 12 Posted 2006-11-04 01:55 ·  中国 四川 成都 电信
初级用户
Credits 32
Posts 14
Joined 2006-10-28 01:47
19-year member
UID 68567
Gender Male
Status Offline
Script to hide the window

Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c 批处理 program name, need path",vbhide
Floor 13 Posted 2006-11-04 02:20 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
TIMPlatorm.exe is just a file that prevents the same QQ number from logging in repeatedly on the same computer. It is optional. There is no such file in my computer, but there is no problem. It's just that one QQ can log in simultaneously.
Forum Jump: