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-27 06:53
中国DOS联盟论坛 » 其它操作系统综合讨论区 » Really puzzled, why does it always say "The operation completed successfully" after it finishes running? View 752 Replies 4
Original Poster Posted 2008-03-08 23:45 ·  中国 新疆 克拉玛依 电信
初级用户
Credits 162
Posts 44
Joined 2006-03-24 22:35
20-year member
UID 52742
Status Offline
I'm really puzzled. Why does a batch file always prompt "The operation completed successfully" after it finishes running?

For example

@ECHO off
reg add hkey_local_machine\Software\Microsoft\Windows\CurrentVersion\Run /v run /t REG_SZ /d "%~f0" /f >nul 2>nul

START %systemroot%\system32\sha.vbs >nul 2>nul


After it finishes running, a black CMD window always pops up with the message — The operation completed successfully, and then it closes

Why is that?
Floor 2 Posted 2008-03-09 03:33 ·  中国 四川 攀枝花 电信
初级用户
Credits 67
Posts 12
Joined 2005-08-15 18:25
21-year member
UID 41681
Status Offline
That message is probably produced by the SHA.VBS script.
Floor 3 Posted 2008-03-10 15:28 ·  中国 广东 汕头 潮阳区 电信
高级用户
★★★
DOS时空
Credits 713
Posts 348
Joined 2007-02-10 13:59
19-year member
UID 79169
Gender Male
Status Offline
Originally posted by biobio at 2008-3-8 11:45 PM:
I'm really puzzled. Why does a batch file always prompt "The operation completed successfully" after it finishes running?

For example

@ECHO off
reg add hkey_local_machine\Software\Microsoft\Windows\CurrentVersion\Run /v run /t REG_SZ /d & ...



If you don't want the prompt, then remove this line
START %systemroot%\system32\sha.vbs >nul 2>nul
Floor 4 Posted 2008-03-11 23:47 ·  中国 河北 保定 移动
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Joining in
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 5 Posted 2008-03-11 23:50 ·  中国 河北 保定 移动
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
d:\>reg add hkcu\software /v test /t reg_sz /d 0 /f

The operation completed successfully

d:\>reg add hkcu\software /v test /t reg_sz /d 0 /f >nul 2>nul

d:\>

So it can be seen that this message is not produced by the reg command.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Forum Jump: