中国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-08-27 06:01
47,812 topics / 349,912 posts / today 2 new / 48,264 members
其它操作系统综合讨论区 » Really puzzled, why does it always say "The operation completed successfully" after it finishes running?
Printable Version  750 / 4
Floor1 biobio Posted 2008-03-08 23:45
初级用户 Posts 44 Credits 162
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?
Floor2 icevan Posted 2008-03-09 03:33
初级用户 Posts 12 Credits 67
That message is probably produced by the SHA.VBS script.
Floor3 haiou327 Posted 2008-03-10 15:28
高级用户 Posts 348 Credits 713
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
Floor4 Climbing Posted 2008-03-11 23:47
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
Joining in
Floor5 Climbing Posted 2008-03-11 23:50
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
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.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023