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-06-25 08:24
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Solved] Who knows VBS, help make a countdown. View 4,711 Replies 20
Floor 16 Posted 2006-10-19 21:20 ·  中国 甘肃 兰州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
MSG is used well.
Floor 17 Posted 2006-10-20 08:05 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
During the countdown, before the time reaches 0, what methods can be used to stop the timing?

There are many methods, basically setting some flags so that the script can detect the flag and exit. For example, judge whether a certain file exists, and if it does, exit; or judge the registry key value, and so on and so forth.
But I suggest using taskkill /fi "WINDOWTITLE eq xxx" in the bat to achieve it, or directly end wscript.exe.
In addition, due to limited time yesterday, the problem was not completely solved. Regarding the issue of specifying the coordinates of the pop-up window, it can be achieved by modifying the registry.
1. Under HKEY_CURRENT_USER\Console, create a new primary key, and the name is the window title name
2. Then create a reg_dword key on the right side: WindowPosition, the value is xxxxyyyy, where xxxx is the horizontal coordinate in hexadecimal, and yyyy is the vertical coordinate in hexadecimal. For example, if you want the window reference coordinates to be 10, 10, you can set its value to a000a
In this way, when you open a character with the title of the primary key established in the above step 1 again, the window coordinates will appear at the coordinates specified in step 2.
Floor 18 Posted 2006-10-20 09:09 ·  中国 广东 佛山 广东睿江科技有限公司
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline
Originally posted by 3742668 at 2006-10-20 08:05:

There are many methods, nothing more than setting some flags so that the script detects the flag and exits. For example, determine whether a certain file exists; if it does, exit; or determine the registry key value, and so on and so forth.
But I suggest still...


The moderator is really powerful...

Using taskkill to close processes is much better and more stable and secure than using Sendkeys...

I don't know if it's a system factor... The command line of the moderator has some small problems when tested on my computer...

That is, after running this command (referring to taskkill /fi.... this command), it will prompt "Information: No running tasks with the specified criteria."

After I looked at the help of taskkill, I modified it a little: taskkill /fi "windowtitle eq xxx*" and then there was no error. (Add a wildcard after the title)

----------------------------------------------------------------------------

In addition, I hope that the helpless moderator will see this post and give me and all the forum friends some guidance on the msg command...

I have looked at the msg command in CMD for a long time and also tried to write it myself...

But all appeared the error prompt of "Error 1702 when getting the session name" (including the command you wrote for me)...
Floor 19 Posted 2006-10-20 09:28 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Regarding the issue with taskkill, it's because your title is different from the title in taskkill, although they seem the same. Actually, if I were using it myself, I would definitely use wmic process to end the process, because in it you can use commandline to judge the started command, and there will be absolutely no wrong judgment.

Regarding the issue with msg, it is initially considered that the relevant service is not enabled. Personally, I guess it is related to rpc. It is suggested to check whether the Terminal Services service is started, and you can also run wmic process where "caption='svchost.exe'" get commandline to see if there are services such as C:\WINDOWS\system32\svchost -k DcomLaunch, C:\WINDOWS\system32\svchost -k rpcss, C:\WINDOWS\System32\svchost.exe -k netsvcs, C:\WINDOWS\system32\svchost.exe -k NetworkService, C:\WINDOWS\system32\svchost.exe -k LocalService, etc.

Of course, the above are all just guesses and may not necessarily be correct. But it is still suggested to work on the services.

P.S: I have seen that many ghost versions of XP downloaded from the Internet are missing many functions, especially those of Tomato Garden, and also the home edition of XP (you don't seem to be...).
Floor 20 Posted 2006-10-20 11:02 ·  中国 广东 佛山 广东睿江科技有限公司
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline
The moderator is really powerful.

I'm using Tomato's system, but it's not a Ghost one, it's an original pure installation...

In addition, I used Tomato's service optimization and then manually enabled some needed services...

After executing "wmic process where "caption='svchost.exe'" get commandline", the following is displayed:

C:\WINDOWS\system32\svchost -k DcomLaunch
C:\WINDOWS\system32\svchost -k rpcss
C:\WINDOWS\System32\svchost.exe -k netsvcs
C:\WINDOWS\system32\svchost.exe -k NetworkService
C:\WINDOWS\system32\svchost.exe -k imgsvc


Thank you very much, moderator 3742668 for your enthusiasm and patience...

I've been here for more than a year, and I've learned a lot...

The reason is that there are many friends like the moderator who are enthusiastic...

Here I want to say: Thank you, moderator 3742668, and thank the friends who have helped me on the forum...
Floor 21 Posted 2006-10-20 11:15 ·  中国 广东 佛山 广东睿江科技有限公司
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline
Well. By the way, the error after msg should be caused by the shutdown of the Terminal Services service. Because the Terminal Services service in my computer is exactly shut down.
Forum Jump: