|
-
June 7th, 2007, 09:01 PM
#1
Time Delay in Ending Batch Process?
I wrote a batch file that swaps some files around to configure the flight dynamics of a Flight Simulator aircraft that I have installed. The batch file offers the user 5 menu choices, and upon selection, deletes the existing flight dynamics .cfg (aircraft.cfg), moves a .txt file into the active folder, and then renames the .txt file "aircraft.cfg".
Upon completion of the file swap, I used "goto done" to echo some final instructions to the user and credit myself for the "configuration utility". From "done", I used @pause (press any key to continue) which takes the user to "end" and of course ends the batch process and closes the DOS window. I just think "Press any key to continue" is inappropriate for ending the batch job. "Press any key to close the configuration utility" would be fine, but I don't know how to do that either.
I'd really like it to go to "end" on it's own, after a 10 second delay for the user to read the final instructions, without further input from the user. Something with a countdown like "Batch process terminating in: 10, 9, 8, seconds" would be great. Is there any way to do this?
Here's my file:
Code:
@echo off
echo Project Opensky 767-300 flight dynamics configuration utility
echo -------------------------------------------------------------
echo.
echo 1. Configure "realistic" FDE for 767-300ER w/GE CF6-80C2 engines
echo applicable for use with:
echo Air Canada NOC, All Nippon Airways NC, American Airlines N376AN
echo Delta Air Lines NOC, LAN Chile NC, Air New Zealand "Lord of the Rings"
echo.
echo 2. Configure "realistic" FDE for 767-300ER w/PW 4060 engines
echo applicable for use with:
echo Hawaiian Airlines N587HA, Martinair NC, Thomas Cook (circa 2004) D-ABUB
echo United Airlines NC, Posky House Colors
echo.
echo 3. Configure "realistic" FDE for 767-300 w/GE-CF6-80C2 engines
echo applicable for use with:
echo Japan Airlines NC,
echo.
echo 4. Configure "realistic" FDE for 767-300FER(cargo version)w/GE-CF6-80C2 engines
echo applicable for use with:
echo UPS NC,
echo.
echo 5. Configure "Easy" FDE for 767-300 w/any engine
echo applicable for use with any variation
echo.
choice /C:12345 Select a configuration from the list above
if errorlevel 5 goto 767-300-Easy
if errorlevel 4 goto 767-300FER-GE-CF6-80C2
if errorlevel 3 goto 767-300-GE-CF6-80C2
if errorlevel 2 goto 767-300ER-PW4060
if errorlevel 1 goto 767-300ER-GE-CF6-80C2
:767-300ER-GE-CF6-80C2
cls
echo.
echo You've chosen "realistic" FDE for 767-300ER w/GE CF6-80C2 engines
echo applicable for use with:
echo Air Canada NOC, All Nippon Airways NC, American Airlines N376AN
echo Delta Air Lines NOC, LAN Chile NC, Air New Zealand "Lord of the Rings"
echo.
@pause
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300ER-GE-CF6-80C2.txt
ren 767-300ER-GE-CF6-80C2.txt aircraft.cfg
goto done
:767-300ER-PW4060
cls
echo.
echo You've chosen "realistic" FDE for 767-300ER w/PW 4060 engines
echo applicable for use with:
echo Hawaiian Airlines N587HA, Martinair NC, Thomas Cook (circa 2004) D-ABUB
echo United Airlines NC, Posky House Colors
echo.
@pause
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300ER-PW4060.txt
ren 767-300ER-PW4060.txt aircraft.cfg
goto done
:767-300-GE-CF6-80C2
cls
echo.
echo You've chosen "realistic" FDE for 767-300 w/GE-CF6-80C2 engines
echo applicable for use with:
echo Japan Airlines NC,
echo.
@pause
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300-GE-CF6-80C2.txt
ren 767-300-GE-CF6-80C2.txt aircraft.cfg
goto done
:767-300FER-GE-CF6-80C2
cls
echo.
echo You've chosen "realistic" FDE for 767-300FER(cargo version)w/GE-CF6-80C2 engines
echo applicable for use with:
echo UPS NC,
echo.
@pause
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300FER-GE-CF6-80C2.txt
ren 767-300FER-GE-CF6-80C2.txt aircraft.cfg
goto done
:767-300-Easy
cls
echo.
echo You've chosen "Easy" FDE for 767-300 w/any engine
echo applicable for use with any variation
echo.
@pause
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300-Easy.txt
ren 767-300-Easy.txt aircraft.cfg
goto done
:done
cls
echo.
echo The FDE has been configured according to your selection. Start Flight Simulator
echo and chose your aircraft from the "Select Aircraft" menu under:
echo.
echo Manufacturer: Project Opensky
echo Model: 767-300
echo.
echo This configuration utility was created by Jim Robinson
echo.
@pause
goto end
:end
Thanks, I appreciate any input anyone might have.
Jim
- ASUS A7V266-E
- Athlon XP 1900+
- Coolermaster HHC-001 CPU Cooler
- 512 MB Crucial PC2100 DDR RAM
- ASUS V8200T2, 64MB (GeForce 3 Ti200)
- Twin 40 GB, 7200 RPM Western Digital IDE Ultra ATA 100, RAID 0 (FAT 32)
- Enermax EG365P-VE(FCA) 350w ATX Power Supply
- Lite-On 8x-4x-12x DVD-RW/+RW
- Lite-On 16x DVD-ROM
- Lian-Li PC-61 Aluminum ATX Case
- Dual Boot, Windows 98se, Windows XP Pro
-
June 8th, 2007, 12:06 PM
#2
-
June 8th, 2007, 12:14 PM
#3
Never mind, I got it sorted. I wound up using another menu in "done" with the options:
[1] Return to Main Menu
[2] Exit The Configuration Utility
I actually found a couple time delay snippets, one even with a countdown timer using "ping" ( ) on the local machine, but I like the menu options better. Don't know why it didn't dawn on me to add a menu in the first place, but this is my first batch file with a menu and the first time I've ever used "choice" so I was having a little trouble getting my head around it.
Anyway, it's evolved quite a bit since I first posted it. Heck, I've even got colors and a fancy title in the title bar.
Take a look:
Code:
:start
@echo off
mode con: Cols=82 Lines=32
Color 17
TITLE 767-300 Configuration Utility
echo.
echo Project Opensky 767-300 Flight Dynamics Configuration Utility
echo -------------------------------------------------------------
echo.
echo Make a selection from the options below [1,2,3,4,5 or 6]
echo:
echo [1] Configure "realistic" FDE for 767-300ER w/GE CF6-80C2 engines
echo applicable for use with:
echo Air Canada NOC, All Nippon Airways NC, American Airlines N376AN
echo Delta Air Lines NOC, LAN Chile NC, Air New Zealand "Lord of the Rings"
echo.
echo [2] Configure "realistic" FDE for 767-300ER w/PW 4060 engines
echo applicable for use with:
echo Hawaiian Airlines N587HA, Martinair NC, Thomas Cook (circa 2004) D-ABUB
echo United Airlines NC, Posky House Colors
echo.
echo [3] Configure "realistic" FDE for 767-300 w/GE-CF6-80C2 engines
echo applicable for use with:
echo Japan Airlines NC
echo.
echo [4] Configure "realistic" FDE for 767-300FER(cargo version)w/GE-CF6-80C2 engines
echo applicable for use with:
echo UPS NC
echo.
echo [5] Configure "Easy" FDE for 767-300 w/any engine
echo applicable for use with any variation
echo.
echo [6] Exit the configuration utility without changing anything
choice /n /C:123456
if errorlevel 6 goto abort
if errorlevel 5 goto 767-300-Easy
if errorlevel 4 goto 767-300FER-GE-CF6-80C2
if errorlevel 3 goto 767-300-GE-CF6-80C2
if errorlevel 2 goto 767-300ER-PW4060
if errorlevel 1 goto 767-300ER-GE-CF6-80C2
:767-300ER-GE-CF6-80C2
cls
echo.
echo You have selected "Realistic" FDE for 767-300ER w/GE CF6-80C2 engines
echo.
echo Boeing 767-300ER (Extended Range)
echo.
echo Engines: General Electric CF6-80C2
echo Static Thrust: 60,800 lbs. x 2
echo.
echo Fuel: Left wing 8350 US gal
echo Right wing 8350 US gal
echo Center 7440 US gal
echo Total 24,140 US gal
echo.
echo Empty Weight 198,443 lbs.
echo Maximum ZFW: 295,000 lbs.
echo Maximum TOW: 409,000 lbs.
echo.
echo Use this FDE with the following liveries:
echo.
echo Air Canada NOC
echo All Nippon Airways NC
echo American Airlines N376AN
echo Delta Air Lines NOC
echo LAN Chile NC
echo Air New Zealand "Lord of the Rings"
echo.
echo.
echo Press [1] to configure the aircraft
echo Press [2] To Return To Main Menu
echo Press [3] To Exit The Configuration Utility
choice /n /C:123
if errorlevel 3 goto abort
if errorlevel 2 goto start
if errorlevel 1 goto 767-300ER-GE-CF6-80C2-a
:767-300ER-GE-CF6-80C2-a
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300ER-GE-CF6-80C2.txt
ren 767-300ER-GE-CF6-80C2.txt aircraft.cfg
goto done
:767-300ER-PW4060
cls
echo.
echo You have selected "Realistic" FDE for 767-300ER w/PW 4060 engines
echo.
echo Boeing 767-300ER (Extended Range)
echo.
echo Engines: Pratt ^& Whitney 4060
echo Static Thrust: 60,250 lbs. x 2
echo.
echo Fuel: Left wing 8350 US gal
echo Right wing 8350 US gal
echo Center 7440 US gal
echo Total 24,140 US gal
echo.
echo Empty Weight 198,443 lbs.
echo Maximum ZFW: 295,000 lbs.
echo Maximum TOW: 409,000 lbs.
echo.
echo Use this FDE with the following liveries:
echo.
echo Hawaiian Airlines N587HA
echo Martinair NC
echo Thomas Cook (circa 2004) D-ABUB
echo United Airlines NC
echo Posky House Colors
echo.
echo.
echo Press [1] to configure the aircraft
echo Press [2] To Return To Main Menu
echo Press [3] To Exit The Configuration Utility
choice /n /C:123
if errorlevel 3 goto abort
if errorlevel 2 goto start
if errorlevel 1 goto 767-300ER-PW4060-a
:767-300ER-PW4060-a
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300ER-PW4060.txt
ren 767-300ER-PW4060.txt aircraft.cfg
goto done
:767-300-GE-CF6-80C2
cls
echo.
echo You have selected "Realistic" FDE for 767-300 w/GE-CF6-80C2 engines
echo.
echo Boeing 767-300
echo.
echo Engines: General Electric CF6-80C2
echo Static Thrust: 60,800 lbs. x 2
echo.
echo Fuel: Left wing 8350 US gal
echo Right wing 8350 US gal
echo Center N/A
echo Total 16,700 US gal
echo.
echo Empty Weight 198,443 lbs.
echo Maximum ZFW: 295,000 lbs.
echo Maximum TOW: 395,000 lbs.
echo.
echo Use this FDE with the following liveries:
echo.
echo Japan Airlines NC
echo.
echo.
echo Press [1] to configure the aircraft
echo Press [2] To Return To Main Menu
echo Press [3] To Exit The Configuration Utility
choice /n /C:123
if errorlevel 3 goto abort
if errorlevel 2 goto start
if errorlevel 1 goto 767-300-GE-CF6-80C2-a
:767-300-GE-CF6-80C2-a
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300-GE-CF6-80C2.txt
ren 767-300-GE-CF6-80C2.txt aircraft.cfg
goto done
:767-300FER-GE-CF6-80C2
cls
echo.
echo You have selected "Realistic" FDE for 767-300 w/GE-CF6-80C2 engines
echo.
echo Boeing 767-300F/ER (Freight, Extended Range)
echo.
echo Engines: General Electric CF6-80C2
echo Static Thrust: 60,800 lbs. x 2
echo.
echo Fuel: Left wing 8350 US gal
echo Right wing 8350 US gal
echo Center 7440 US gal
echo Total 24,140 US gal
echo.
echo Empty Weight 198,443 lbs.
echo Maximum ZFW: 295,000 lbs.
echo Maximum TOW: 412,000 lbs.
echo.
echo Use this FDE with the following liveries:
echo.
echo UPS NC
echo.
echo.
echo Press [1] to configure the aircraft
echo Press [2] To Return To Main Menu
echo Press [3] To Exit The Configuration Utility
choice /n /C:123
if errorlevel 3 goto abort
if errorlevel 2 goto start
if errorlevel 1 goto 767-300FER-GE-CF6-80C2-a
:767-300FER-GE-CF6-80C2-a
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300FER-GE-CF6-80C2.txt
ren 767-300FER-GE-CF6-80C2.txt aircraft.cfg
goto done
:767-300-Easy
cls
echo.
echo You have selected "Easy" FDE for 767-300 w/any engine
echo.
echo Boeing 767-300ER (Extended Range)
echo.
echo Engines: Not Specified
echo Static Thrust: 60,250 lbs. x 2
echo.
echo Fuel: Left wing 8350 US gal
echo Right wing 8350 US gal
echo Center 7440 US gal
echo Total 24,140 US gal
echo.
echo Empty Weight 198,443 lbs.
echo Maximum ZFW: 295,000 lbs.
echo Maximum TOW: 700,000 lbs.
echo.
echo Use this FDE with any variation
echo.
echo.
echo Press [1] to configure the aircraft
echo Press [2] To Return To Main Menu
echo Press [3] To Exit The Configuration Utility
choice /n /C:123
if errorlevel 3 goto abort
if errorlevel 2 goto start
if errorlevel 1 goto 767-300-Easy-a
:767-300-Easy-a
@echo off
cd ..
del /q aircraft.cfg
copy configuration\767-300-Easy.txt
ren 767-300-Easy.txt aircraft.cfg
goto done
:abort
cls
echo.
echo No changes have been made to the aircraft's configuration. You may run the
echo Configuration Utility again at any time. See "readme.txt" for more information.
echo.
echo.
echo Press [1] To Return To Main Menu
echo Press [2] To Exit The Configuration Utility
echo.
echo.
echo.
echo.
echo This configuration utility was created by Jim Robinson
choice /n /C:12
if errorlevel 2 goto end
if errorlevel 1 goto start
:done
cls
cd configuration
echo.
echo The FDE has been configured according to your selection. Start Flight Simulator
echo and chose your aircraft from the "Select Aircraft" menu under:
echo.
echo Manufacturer: Project Opensky
echo Model: 767-300
echo.
echo.
echo Press [1] To Return To Main Menu
echo Press [2] To Exit The Configuration Utility
echo.
echo.
echo.
echo.
echo This configuration utility was created by Jim Robinson
choice /n /C:12
if errorlevel 2 goto end
if errorlevel 1 goto start
:end
exit
Thanks,
Jim
- ASUS A7V266-E
- Athlon XP 1900+
- Coolermaster HHC-001 CPU Cooler
- 512 MB Crucial PC2100 DDR RAM
- ASUS V8200T2, 64MB (GeForce 3 Ti200)
- Twin 40 GB, 7200 RPM Western Digital IDE Ultra ATA 100, RAID 0 (FAT 32)
- Enermax EG365P-VE(FCA) 350w ATX Power Supply
- Lite-On 8x-4x-12x DVD-RW/+RW
- Lite-On 16x DVD-ROM
- Lian-Li PC-61 Aluminum ATX Case
- Dual Boot, Windows 98se, Windows XP Pro
-
June 8th, 2007, 07:15 PM
#4
Incidentally jdc2000, the "never mind" was not in response to your post. Apparently we were both posting at roughly the same time. I didn't notice your post until I checked my e-mail a few minutes ago. I appreciate the time you spent finding those links. I'd seen the ericphelps site yesterday via a google search.
Thanks,
Jim
- ASUS A7V266-E
- Athlon XP 1900+
- Coolermaster HHC-001 CPU Cooler
- 512 MB Crucial PC2100 DDR RAM
- ASUS V8200T2, 64MB (GeForce 3 Ti200)
- Twin 40 GB, 7200 RPM Western Digital IDE Ultra ATA 100, RAID 0 (FAT 32)
- Enermax EG365P-VE(FCA) 350w ATX Power Supply
- Lite-On 8x-4x-12x DVD-RW/+RW
- Lite-On 16x DVD-ROM
- Lian-Li PC-61 Aluminum ATX Case
- Dual Boot, Windows 98se, Windows XP Pro
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|