symis
2010-05-04, 01:45 PM
遠端以VPN連入公司的windows 2003 server,自動執行一個批次檔如下,請問:
1. 要如何防止user用Ctrl-C或Ctrl-Break去中斷批次檔?
2. 還有什麼可以改善的地方?
thanks!
----------------
@echo off
cls
echo * * * * * * * * * * * * * * * *
echo * a. A 系 統 *
echo * b. B 系 統 *
echo * q. 離 開 *
echo * * * * * * * * * * * * * * * *
choice /C abq /M "請按鍵(大小寫均可)"
if errorlevel 3 goto option3
if errorlevel 2 goto option2
if errorlevel 1 goto option1
goto End
: option1
a.exe
goto End
: option2
b.exe
goto End
: option3
exit
goto End
: end
c:
cd\temp\test
menu.bat
1. 要如何防止user用Ctrl-C或Ctrl-Break去中斷批次檔?
2. 還有什麼可以改善的地方?
thanks!
----------------
@echo off
cls
echo * * * * * * * * * * * * * * * *
echo * a. A 系 統 *
echo * b. B 系 統 *
echo * q. 離 開 *
echo * * * * * * * * * * * * * * * *
choice /C abq /M "請按鍵(大小寫均可)"
if errorlevel 3 goto option3
if errorlevel 2 goto option2
if errorlevel 1 goto option1
goto End
: option1
a.exe
goto End
: option2
b.exe
goto End
: option3
exit
goto End
: end
c:
cd\temp\test
menu.bat