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-07-24 00:32
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » Want to load something in AUTOEXEC.bat, how to write it View 1,810 Replies 11
Original Poster Posted 2006-10-18 01:47 ·  中国 广东 潮州 电信
新手上路
Credits 12
Posts 4
Joined 2006-10-17 11:57
19-year member
UID 66113
Status Offline
Want to load something in AUTOEXEC.bat, how to write it?

@ECHO OFF (Just can't display Chinese, using TW will have screen flicker, the system is XP)
pbios
font16
hzvio95
hzkbd
ctrlpan
CLS
ECHO OFF
ECHO ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
ECHO ┃             !!!Warning!!!              ┃
ECHO ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
ECHO ┃ The following will restore your system to the initial state, but all existing data on drive C will be lost!   ┃
ECHO ┃                                  ┃
ECHO ┃ Press any key to continue and there will be no more prompts, press CTRL + C, and then type Y in the subsequent prompt to exit.   ┃
ECHO ┃                                 ┃
ECHO ┃ Prompt to exit.                       ┃
ECHO ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
PAUSE
Floor 2 Posted 2006-10-18 05:45 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Floor 3 Posted 2006-10-18 06:55 ·  中国 广东 潮州 电信
新手上路
Credits 12
Posts 4
Joined 2006-10-17 11:57
19-year member
UID 66113
Status Offline
Originally posted by he200377 at 2006-10-18 05:45:
Using set /p

Newcomer here, don't understand where to add it, please advise!
Floor 4 Posted 2006-10-18 07:04 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
"Press any key to continue and no more prompts, press CTRL + C" This is quite dangerous!!! There's always a case where you press an extra key, then it's all over : ( It's better to use Y and N to let the user decide whether to perform some potentially dangerous operations ~ : )
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 5 Posted 2006-10-18 07:06 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Originally posted by angel25 at 2006-10-18 06:55:

Newcomer here, don't know where to add it, please advise!!




SET /P is to get the content entered by the user's keyboard or redirecting...


For more detailed content, you need to look at the DOS help:     SET /?
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 6 Posted 2006-10-18 07:08 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Originally posted by angel25 at 2006-10-18 06:55:

Newcomer here, don't know where to add, please advise!!


set var=
set /p var= Select operation:
if == goto y
if == goto n
Floor 7 Posted 2006-10-18 07:26 ·  中国 广东 潮州 电信
新手上路
Credits 12
Posts 4
Joined 2006-10-17 11:57
19-year member
UID 66113
Status Offline
Thanks for everyone's help, but the most important thing now is that Chinese characters cannot be displayed, and there is garbled text?
Floor 8 Posted 2006-10-18 11:48 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
You'd better first explain whether this AUTOEXEC.bat is for use under XP or pure DOS, otherwise it will take a lot of detours!
1: set /p has no such parameter under pure DOS
2: XP does not need to load the Chinese system
3: Under XP, ghost cannot be used for restoration, that is, even if ghost32 is used, the C drive is protected by the XP system itself
第一高手 第二高手

Floor 9 Posted 2006-10-19 12:05 ·  中国 陕西 咸阳 电信
新手上路
Credits 12
Posts 6
Joined 2006-09-14 13:10
19-year member
UID 62572
Status Offline
What the person upstairs said is very correct! Haha!

If it is run under pure DOS, you just need to slightly modify the above batch file:

@ECHO OFF
tw /np>nul
CLS
ECHO ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
ECHO ┃             !!!Warning!!!             ┃
ECHO ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
ECHO ┃ The following will restore your system to the initial state, but all existing data on drive C will be lost!   ┃
ECHO ┃                               ┃
ECHO ┃ Press any key to continue and there will be no more prompts. Press CTRL + C, and then type Y to exit after the subsequent prompt.   ┃
ECHO ┃                                 ┃
ECHO ┃ Prompt after typing Y to exit.                       ┃
ECHO ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
PAUSE

Note that if there are no characters after ECHO, you need to add a "."

You can also use the following batch file:

@echo off
SHCDX33A /D:MSCD001 /L:Z /V
TW /NP>nul

:DISPLAY
cls
echo.
echo 1. Boot to GHOST8.3
echo.
echo 2. Directly restore the system to drive C
echo.
echo 3. Boot to DOS
echo.
echo.
echo.
choice /c:123

if errorlevel 4 goto DISPLAY
if errorlevel 3 goto MENU3
if errorlevel 2 goto MENU2
if errorlevel 1 goto MENU1

:MENU1
MOUSE.COM
GHOST.EXE
RESTART

:MENU2
ghost.exe -clone,mode=pload,src=z:\ghost\winxp.gho:1,dst=1:1 -sure -rb

:MENU3

Because the above MENU1 and 2 have direct boot items, the corresponding goto statements are omitted;
The "src=z:\ghost\winxp.gho:1" in the statement can be replaced with your own ghost image path and name.

[ Last edited by vhhshl on 2006-10-19 at 12:32 ]
Floor 10 Posted 2006-10-19 14:11 ·  中国 广东 广州 番禺区 电信
初级用户
★★
Credits 167
Posts 80
Joined 2005-11-07 05:08
20-year member
UID 44725
Gender Male
Status Offline
The person upstairs has a lot of patience!
Floor 11 Posted 2006-10-25 10:13 ·  中国 吉林 通化 联通
初级用户
Credits 73
Posts 26
Joined 2006-05-03 08:32
20-year member
UID 54858
Status Offline
Oh, can't upload attachments!!
Floor 12 Posted 2006-10-26 00:25 ·  中国 广东 河源 电信
新手上路
Credits 6
Posts 3
Joined 2006-10-25 10:27
19-year member
UID 68204
Gender Male
Status Offline
Forum Jump: