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-03 14:50
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Batch file won't run (can't spot the error) View 1,025 Replies 9
Original Poster Posted 2007-02-06 20:33 ·  中国 浙江 杭州 电信
新手上路
Credits 17
Posts 7
Joined 2007-01-06 17:01
19-year member
UID 75642
Gender Female
Status Offline
Could everyone please help me take a look, where is the error in this batch file below?
Batch file 1:
@echo off
cls
echo ╔------------------------------------------╗
echo 123456
pause
exit

It's this simple, yet it still won't run.
It's driving me crazy, I just can't see what's wrong,

Batch file 2:
@echo off
cls
echo ╔------------------------------------------╗
echo ┆ Thank you for your cooperation! ┆
echo ┆ Virus removal successful! ┆
echo ┆ By:八戒 ┆
echo ╚------------------------------------------╝

color 0d


pause

:end
But this batch file 2 works fine and displays normally. Why is it that batch file 1 just flashes a black screen and disappears?

I just can't see what's wrong no matter how I look, I feel like crying~

Experts, save me

[ Last edited by 8j on 2007-2-6 at 07:40 AM ]
Floor 2 Posted 2007-02-06 20:36 ·  中国 浙江 杭州 电信
新手上路
Credits 17
Posts 7
Joined 2007-01-06 17:01
19-year member
UID 75642
Gender Female
Status Offline
I worked on it for a long time. Originally I wanted to make a batch file that imports the registry,
then this problem came up,
I kept simplifying the batch file, and in the end it became this simple, and it still doesn't work,
I'm going crazy,
Floor 3 Posted 2007-02-06 21:05 ·  中国 江苏 苏州 联通
银牌会员
★★★
Credits 1,181
Posts 533
Joined 2006-08-14 12:54
19-year member
UID 60484
Status Offline
It runs completely normally for me, I see this.

╔------------------------------------------╗
123456
Press any key to continue. . .
Floor 4 Posted 2007-02-06 21:51 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
  Did you save the first BAT as a Unicode-format file?
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 5 Posted 2007-02-18 15:06 ·  中国 湖北 潜江 电信
高级用户
★★★
Credits 894
Posts 411
Joined 2007-02-17 12:15
19-year member
UID 79697
Gender Male
Status Offline
No problem
Floor 6 Posted 2007-02-18 15:37 ·  美国 弗吉尼亚州 华盛顿县 Microsoft
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 7 Posted 2007-02-19 08:18 ·  中国 河南 郑州 联通
初级用户
Credits 88
Posts 40
Joined 2006-12-26 07:32
19-year member
UID 74591
Gender Male
Status Offline
It displays completely normally on my side too.........
Floor 8 Posted 2007-02-19 10:07 ·  中国 四川 泸州 联通
高级用户
★★★
Credits 609
Posts 374
Joined 2006-08-02 22:38
20-year member
UID 59720
Status Offline
No problem, it displays normally
Floor 9 Posted 2007-02-20 05:08 ·  中国 广东 茂名 电信
中级用户
★★
Credits 261
Posts 123
Joined 2006-06-06 19:23
20-year member
UID 56648
Status Offline
No need to say it, you definitely saved the first BAT as a Unicode-format file
Floor 10 Posted 2007-02-22 06:24 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 866
Posts 415
Joined 2005-12-04 11:19
20-year member
UID 46459
Status Offline
Batch files can be pretty "tricky" sometimes too.
Forum Jump: