无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 7544|回复: 6
打印 上一主题 下一主题

DOS 中怎样使用USB设备

[复制链接]
跳转到指定楼层
1#
发表于 2006-3-10 13:41:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[这个贴子最后由我是神仙在 2006/03/21 00:11am 第 1 次编辑]

DOS USB Drivers
There are several ways folks are getting their USB CDroms, Hard Drives, and other drives to work in DOS. One is using what';s known as DUSE driver system. The second method is using what looks somewhat like standard CDrom driver files and a USB driver. Both methods appear to require loading an usbaspiX.sys file first in config.sys in most cases. The third method is a bootdisk from a USB vendor. Method 4 is getting good reviews also.
METHOD 1 - The DUSE System
Example 1 Using DUSE
[config.sys]
device=a:\himem.sys
devicehigh=a:\emm386.exe
device=a:\usbaspi.sys
dos=high,umb
[autoexec.bat]
@echo off
duseldr a:\duse.exe
MSCDEX /D:USBCDROM /S /M:15 /V
Example 2 Using DUSE
[config.sys]
device=a:\himem.sys
DEVICE=a:\duse.exe
[autoexec.bat]
MSCDEX /D:USBCDROM /S /M:15 /V

METHOD 2 - The usbaspi.sys/usbcd.sys System - Example 1
As noted, this method seems just like loading IDE drivers, with the added entry of the usbaspiX file. The following are the relevant portions taken from a modified config.sys and autoexec.bat file which was designed to work with a Windows 98 OEM Bootdisk with the ramdrive.
The complete config.sys and autoexec.bat replacement files are available for download below, and you might want to start first with just copying them to your OEM bootdisk along with the relevant drivers and then experiment later with getting them to work on your Customized disk.
[config.sys - example 1]
device=himem.sys /testmem:off
device=usbaspiX.sys
device=usbcdX.sys /D:mscd001
[config.sys example 2 - USB Floppy in only port, "sometimes" allows switching to CDrom after boot]
device=himem.sys /testmem:off
device=ramfd.sys
device=usbaspiX.sys /W
device=usbcdX.sys /D:mscd001
[autoexec.bat]
LH %ramd%:\MSCDEX.EXE /D:mscd001 /L:%CDROM%

METHOD 2 - The usbaspi.sys/usbcd.sys System - Example 2
"I finally got my Belkin external drive enclosure with a WD 120gb drive to work in DOS, and then perform a GHOST image", wrote don b. "Here';s the files and config.sys that worked."
[config.sys]
device=himem.sys /testmem:off
devicehigh=usbaspi1.sys
devicehigh=di1000dd.sys
devicehigh=usbcd2.sys /d:USBCD001
LASTDRIVE = Z
[autoexec.bat]
don b. noted that either the standard Ghost or Win98X autoexec.bat worked as is.

METHOD 2 - The usbaspi.sys/usbcd.sys System - Example 3
Herbert H. writes: "I Just solved my problem by using the files from the "virtual" DOS drive ghost03 makes when you run interactive mode. It uses IOmega USB drivers and Guest.exe. It alowed me to use my Western Digital external USB HD in DOS.
[config.sys]
LASTDRIVE=Z
DEVICE = usbaspi4.sys /int /all
DEVICE = usbaspi5.sys /int /all
DEVICE = usbaspi5.sys /int /all /D1
DEVICE = usbcdX.sys /D:cd2
DEVICE = OAKCDROM.SYS /D:cd1 [For his IDE CDrom]

METHOD 3 - The datoptic System
A USB 4 DOS bootdisk has been posted here called dat.exe
The key driver files in dat.exe include:
usbaspi.sys 37,090 bytes
nj32disk.sys 15,808
sbp2aspi.sys 28,836
datoptic.com recommends the following config.sys for it';s USB/1394 products. It';s been reported tho that their drivers also work for other brands as well.
[menu]
menuitem=USB,USB Boot
menuitem=1394,1394 Boot
menudefault=USB,30
menucolor=7,0
[USB]
DEVICE = USBASPI.SYS
[1394]
DEVICE = SBP2ASPI.SYS
[COMMON]
DEVICE = NJ32DISK.SYS /R
LASTDRIVE=Z

METHOD 4 - The Iomega Way
Ben B. wrote:
I built a boot disk to access a USB external hard drive from DOS using drivers included with Norton Ghost. 2003. Since Ghost can write to the external drive in DOS, I figured I could copy its drivers. Turns out they are from Iomega. I wanted to access the external drive to run a disk wiping program. Autoexec.bat and Config.sys can be much improved, but this is the bare bones of the boot disk. Note that the Iomega drivers will work with any USB external hard disk and are not proprietary to Iomega drives (mine is a Western Digital).
Config.sys:
DEVICE=aspiehci.sys /int /all
LASTDRIVE=Z
Autoexec.bat:
@echo off
GUEST.EXE
Contents of my boot disk:
aspiehci.sys [Iomega USB 2.0 driver]
Autoexec.bat
Command.com
Config.sys
guest.exe [Another Iomega program required to access the USB drive]
Io.sys
Msdos.sys
Thanks Ben. Your letter has enough information tho to put folks on the right track to find the drivers themselves. If folks want to save some time tho they can get the drivers here.
+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++
DOWNLOAD FILES:
DUSE 4.4  DUSE 4.9
  With Excellent Docs
The USBdrivers collection includes 5 different usbaspi.sys and 2 usbcd.sys files, the iomega drivers, the ramfd.sys driver, and the modified Win98 OEM config.sys and autoexec.bat files. You will have to experiment to see which one works for you.

The key driver files I';ve put together for you in the [USBdriver] collection include:
ramfd.sys 22,012 bytes
usbaspi1.sys 37,093
usbaspi2.sys 43,528
usbaspi3.sys 37,090
usbaspi4.sys 49,242
usbaspi5.sys 50,606
usbcd1.sys 5,509
usbcd2.sys 35,456
di1000dd.sys 16,368
Iomega:
aspiehci.sys 52,106
aspiehcj.sys 49,772 [renamed - older version of aspiehci.sys]
aspiohci.sys 42,242
aspinhci.sys 50,606
guest.exe 8.5 32,396
Please keep in mind that DOS USB CDrom/HDD/zip/etc. drivers is a brand new and developing area so there is no one single method that is guaranteed to work on every PC. If you try a few methods and have no luck, keep at it and dont worry as I';m confident there is enough information here to get at least 99% of the USB drives to work in dos.
A related article from theinquirer.net
Note that the files referred to in the article are included in my usb driver file download.


+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++
Note that the files posted here are pretty much the most complete collection of USB drivers around. Oddly enough, if you have a USB floppy drive connected to your PC some of these cdrom/hard/zip drive drivers will fail to load or the above bootdisk will fail to work.
In fact, I';d remove ANY USB device you dont need [eg cams, mice, printers, etc.] when using the above files to get DOS access to your Drives.
Note that after you get your business done in DOS with the USB drivers that they really should be remmed out when you';ve done what you needed to and now want Windows to use the drive correctly using Windows drivers.
Also note that windows really doesn';t like being installed from a usb device so if you only have a usb cdrom drive and need to install windows its best to copy the install files to a folder on your hard drive first and do the install from there. For example, if you are using win9X then make a folder on your hard drive called win98 and copy the files from the win98 folder on the cd to c:\win98 then run setup from there.
If using XP then make a folder on your hard drive called i386 and copy the files from the i386 folder on the cd to c:\i386 and run winnt.exe from there.
Please keep in mind that this is a new/developing area and I';m doing the best that I can in providing you with the info as it comes in so you are going to have to do some tweaking in the meantime.
+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++
TESTIMONIALS
From jorj:
I unpacked the zipped file usbdrive.zip on my desktop. Then I looked in it and noticed there are [5] usbaspi.sys and 2 usbcd.sys files. Randomly I took usbaspi1.sys and usbcd1.sys and placed them into win98 startup cd, together with the autoexec.bat and config.sys files, which repalced the original bat/sys files on the startup disk. Then I ran the startup disk and watched the screen. It worked right from the start.

From obiwan
I use your bootdisk site often and your resources have bailed me out on several occasions. I recently set up USB support on some ghost boot disks that we use here and was excited to say the least. It worked on both the Plextor USB CD-ROMS and a Pioneer CD-ROM I have in an ADS USB enclosure. Thanks for the great site and keep up the great work.

From B. K.
Thanks for your excellent website - I just figured out how to read a USB CD drive from DOS solely because of your excellent advice.

From Daniel, Ottawa (Canada)
I just purchaced a USB 2.0 Drive Kit at COSCO. I placed an IDE hard drive in it with all the images of PCs that I GHOST on a regular basis. Thanks to all the info provided on your website, I can now boot in DOS with USB support. I then run my GHOST floppy, and choose the correct image from the "USB Hard Drive". I no longer need multiple CDs... I no longer have to change CDs every 5 minutes for a full hour... I no longer have to burn tons of CDs... Thank you for your great website!

From Angelos
USB to Dos drivers, finally work. After many hours and attempts, I have managed to mount my SuperTalent External HD using the DUSE 4.9 driver found on this excellent site. The Ghost 2003 and DUSE 4.9 fit on a floppy so now I can image my HD my friends HD and so on. Thank you bootdisk you are the greatest.

From Carmen (Spain)
I just want to say thanks to ben b. for sharing his experience. I was able to find the files I needed on the Internet and got my usb hard drive to work which did not come with dos drivers.

From A Gorman (UK)
This site is excellent. Downloaded dos usb drivers and it works great.

From Wim (Holland)
Thanks to [this page] I got my Xterasys - USB 2.0 casing with a WD 80 gig HD, to boot from a DOS bootable floppy disk. Instead of loading the DEVICE=aspiehci.sys /int /all from config.sys [ie the Iomega driver Ben B. used], I loaded DEVICE=ASPIOHCI.SYS /int /all, also a Iomega driver. It works GREAT!!!!

一个批处理:
@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
:: Aspiusb Begin ::
if not exist %ramdrv%\bin\lmod.com %0 : _error missing lmod.com (check utils.%arcext%)
if not exist %ramdrv%\bin\varset.com %0 : _error missing varset.com (check utilz.%arcext%)
:_start
call readset.bat ASPIUSB
if not "%aspiusb_ti%"=="" goto _nodef
set aspiusb_ti=5
set aspiusb_verbose=1
set aspiusb_host=1
:_nodef
for %%i in (-c -C) do if "%1"=="%%i" goto _config
if "%1"=="/c" goto _config
if "%1"=="/C" goto _config
for %%i in (-h -H -?) do if "%1"=="%%i" goto _usage
if "%1"=="/h" goto _usage
if "%1"=="/H" goto _usage
if "%1"=="/?" goto _usage
if "%aspiusb_ncfg%"=="1" goto _nocfg
set wcb1=%aspiusb_install%
call w.bat box @%0:w_cfg #2,%aspiusb_ti%
if errorlevel 3 goto _end
set aspiusb_install=%wcb1%
if errorlevel 2 goto _config
:_nocfg
:_install
if not exist %ramdrv%\bin\usbaspi.sys goto _skipinst
if "%aspiusb_install%"=="1" goto _doinst
:_skipinst
echo ASPIUSB: Skipping USB installation
goto _end
:_doinst
:_do2inst
set _aspiusb=
if "%aspiusb_ehci%"=="1" set _aspiusb=%_aspiusb% /e
if "%aspiusb_ohci%"=="1" set _aspiusb=%_aspiusb% /o
if "%aspiusb_uhci%"=="1" set _aspiusb=%_aspiusb% /u
if "%aspiusb_verbose%"=="1" set _aspiusb=%_aspiusb% /v
if "%aspiusb_wait%"=="1" set _aspiusb=%_aspiusb% /w
if "%aspiusb_resident%"=="1" set _aspiusb=%_aspiusb% /r
if "%aspiusb_slow%"=="1" set _aspiusb=%_aspiusb% /slow
if "%aspiusb_nocbc%"=="1" set _aspiusb=%_aspiusb% /nocbc
if "%aspiusb_noprt%"=="1" set _aspiusb=%_aspiusb% /noprt
if "%aspiusb_norst%"=="1" set _aspiusb=%_aspiusb% /norst
if not "%aspiusb_extra%"=="" set _aspiusb=%_aspiusb% %aspiusb_extra%
echo ASPIUSB: new PC prefers EHCI (/e), old PC prefers UHCI (/u)
echo ASPIUSB: USB-mouse/keyboard may malfunction with UHCI (/u)
echo ASPIUSB: Installing USBASPI.SYS %_aspiusb%
if exist %ramdrv%\bin\snap.com snap.com S=%tmp%\usbaspi.bin
device %ramdrv%\bin\usbaspi.sys %_aspiusb%
if not exist SCSIMGR$ if exist %tmp%\usbaspi.bin del %tmp%\usbaspi.bin >%tmp%\nul
:_skipASPI
set _aspiusb=
if exist SCSIMGR$ goto _instok
echo ASPIUSB: USBASPI.SYS not installed (no USB device detected)
goto _end
:_instok
if "%aspiusb_nodisk%"=="1" goto _skipDD
if not exist %ramdrv%\bin\di1000dd.sys goto _skipDD
if not "%aspiusb_host%"=="" set _aspiusb=/h%aspiusb_host%
if not "%aspiusb_drv%"=="" set _aspiusb=%_aspiusb% /d%aspiusb_drv%
echo ASPIUSB: Installing DI1000DD.SYS %_aspiusb%
if exist %ramdrv%\bin\snap.com snap.com S=%tmp%\di1000dd.bin
call devhigh %ramdrv%\bin\di1000dd.sys %_aspiusb%
:_skipDD
set _aspiusb=

goto _end
:_config
echo :w_config "USB configuration" [x]>%tmp%\_aspiusb.tmp
echo.>>%tmp%\_aspiusb.tmp
echo Dialog timeout [$ aspiusb_ti,3] seconds>>%tmp%\_aspiusb.tmp
echo [!] Skip "Run USB or go config?" dialog>>%tmp%\_aspiusb.tmp
echo.>>%tmp%\_aspiusb.tmp
echo [.] Install USB to ASPI/SCSI driver: >>%tmp%\_aspiusb.tmp
echo     On ';new'; PC pick EHCI only, on ';old'; PC UHCI only>>%tmp%\_aspiusb.tmp
echo     [!] Ehci USB 2.0            (new PC) >>%tmp%\_aspiusb.tmp
echo     [!] Ohci USB 1.1 add-on >>%tmp%\_aspiusb.tmp
echo     [!] Uhci USB 1.1 integrated (old PC) >>%tmp%\_aspiusb.tmp
echo     [!] Verbose (show info, recommended) >>%tmp%\_aspiusb.tmp
echo     [!] Wait (pause to attach USB device) >>%tmp%\_aspiusb.tmp
echo     [!] Resident (use when booting from USB flop) >>%tmp%\_aspiusb.tmp
echo     [!] Slow (use longer delays with USB detection) >>%tmp%\_aspiusb.tmp
echo     [!] NoReset (no Reset on USB Keyb/Mouse) >>%tmp%\_aspiusb.tmp
echo.>>%tmp%\_aspiusb.tmp
echo     Install USB ASPI Mass Storage Driver:>>%tmp%\_aspiusb.tmp
echo     [$ aspiusb_host,1] Host Controller (1..9 or blank for auto) >>%tmp%\_aspiusb.tmp
echo     [$ aspiusb_drv,1,U] First Drive Letter (blank for auto) >>%tmp%\_aspiusb.tmp
if "%ramdrv%"=="" goto _tref
echo       (choose higher drive than ';%ramdrv%'; or leave blank) >>%tmp%\_aspiusb.tmp
:_tref
echo [.] Do NOT install USB to ASPI/SCSI driver >>%tmp%\_aspiusb.tmp
goto _qaw
echo.>>%tmp%\_aspiusb.tmp
echo     [!] NoCBC (no Card Bus Controller detection) >>%tmp%\_aspiusb.tmp
echo     [!] NoPRT (? no Printer detection ?) >>%tmp%\_aspiusb.tmp
:_qaw
echo.>>%tmp%\_aspiusb.tmp
echo               [ Save ]  [? Cancel ]>>%tmp%\_aspiusb.tmp
set wrb=%aspiusb_install%
if not "%wrb%"=="1" set wrb=2
set wcb1=%aspiusb_ncfg%
set wcb2=%aspiusb_ehci%
set wcb3=%aspiusb_ohci%
set wcb4=%aspiusb_uhci%
set wcb5=%aspiusb_verbose%
set wcb6=%aspiusb_wait%
set wcb7=%aspiusb_resident%
set wcb8=%aspiusb_slow%
set wcb9=%aspiusb_norst%
call w.bat box @%tmp%\_aspiusb.tmp:w_config
if errorlevel 2 goto _end
set aspiusb_install=%wrb%
if not "%wrb%"=="1" set aspiusb_install=0
set aspiusb_ncfg=%wcb1%
set aspiusb_ehci=%wcb2%
set aspiusb_ohci=%wcb3%
set aspiusb_uhci=%wcb4%
set aspiusb_verbose=%wcb5%
set aspiusb_wait=%wcb6%
set aspiusb_resident=%wcb7%
set aspiusb_slow=%wcb8%
set aspiusb_norst=%wcb9%
call saveset.bat ASPIUSB
echo.
goto _start
:w_cfg "Run USB or go config?" [x]
       (~press any key~: #? sec.)
  [!] Running ASPIUSB ...
  (Skip running ASPIUSB when it
   disables your USB-Keyboard
   and/or USB-Mouse or try
   enabling EHCI-only)
  [ Ok ] [ Config ] [? Abort ]
::
:_usage
echo Parameters:
echo -c    Config mode
echo -h    This help info
echo.
goto _end
:_error
shift
shift
echo.
echo ASPIUSB: Error %1 %2 %3 %4 %5 %6 %7 %8
echo.
@rem pause
goto _end
:_abort
echo ASPIUSB: Aborted...
echo.
@rem pause
:_end
set | tfind /f1,2 "W_" >%tmp%\_aspiusb.tmp
set | tfind /f1,8 "aspiusb_" >>%tmp%\_aspiusb.tmp
type %tmp%\_aspiusb.tmp | lmod /L* /B= set [$1]=>%tmp%\_aspiusb.bat
call %tmp%\_aspiusb.bat
if exist %tmp%\_aspiusb.* del %tmp%\_aspiusb.*
set _aspiusb=
set ?=
set wcb1=
set wcb2=
set wcb3=
set wcb4=
set wcb5=
set wcb6=
set wcb7=
set wcb8=
set wcb9=
set wrb=
set wbat=
:: Aspiusb End ::



推荐站点:
http://www.bootdisk.info
http://www.bootdisk.com
http://www.netbootdisk.com
http://www.nu2.nu/bootdisk/
2#
 楼主| 发表于 2006-3-21 00:10:12 | 只看该作者

DOS 中怎样使用USB设备

DOS中如何使用SCSI设备
有一大堆的acpiXdos.sys需要选择加载,
怎么选呢,一是让用户自己试,总有一款适合你,
二是写程序写批处理来实现智能选择,
我看到下面这个不错,看起来不错,具体怎么样也不知道哈:

@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
:: Aspi Begin ::
if not exist %ramdrv%\bin\crc32.com %0 : _error missing crc32.com (check utils.%arcext%)
if not exist %ramdrv%\bin\xgrep.com %0 : _error missing xgrep.com (check utilz.%arcext%)
:_start
call readset.bat ASPI
if "%aspi_ti%"=="" set aspi_ti=5
if "%aspi_mode%"=="" set aspi_mode=2
set pci0=
for %%i in (-c -C) do if "%1"=="%%i" goto _config
if "%1"=="/c" goto _config
if "%1"=="/C" goto _config
for %%i in (-h -H -?) do if "%1"=="%%i" goto _usage
if "%1"=="/h" goto _usage
if "%1"=="/H" goto _usage
if "%1"=="/?" goto _usage
if "%aspi_ncfg%"=="1" goto _nocfg
wbat box @%0:w_cfg #1,%aspi_ti%
if errorlevel 3 goto _end
if errorlevel 2 goto _config
:_nocfg
if "%aspi_mode%"=="1" goto _aspi1
if "%aspi_mode%"=="2" goto _aspi2
if "%aspi_mode%"=="3" goto _aspi2
if "%aspi_mode%"=="4" goto _end
goto _aspi2
:_aspi1
set pci0=%aspi_last%
if not "%pci0%"=="" goto _aspi1a
goto _aspi2
:_aspi1a
if exist %ramdrv%\lib\aspi\%pci0%.%arcext% goto _pciok
if exist %srcdrv%\lib\aspi\%pci0%.%arcext% goto _pciok
set pci0=
if "%aspi_no2auto%"=="1" goto _end
:_aspi2
if exist %srcdrv%\lib\aspi\*.%arcext% if not exist %ramdrv%\etc\_aspi.pci goto _bldnic
if not exist %srcdrv%\lib\aspi\*.%arcext% if exist %ramdrv%\etc\_aspi.pci goto _bldnic
if not exist %srcdrv%\lib\aspi\*.%arcext% if not exist %ramdrv%\etc\_aspi.pci goto _end
if not exist %ramdrv%\bin\crc32.com goto _bldnic
if not exist %srcdrv%\lib\aspi\*.%arcext% goto _no16dir
if not exist %ramdrv%\etc\_aspi.pci goto _bldnic
set w_crc=
lmod set w_crc=[&#36;2]<%ramdrv%\etc\_aspi.pci >%tmp%\_aspi.bat
call %tmp%\_aspi.bat
dir %srcdrv%\lib\aspi\*.%arcext% | tfind /F10,3 "cab" >%tmp%\_aspi.tm2
echo ASPI: SCSI ASPI index CRC32 is %w_crc%, checking...
crc32 %tmp%\_aspi.tm2 %w_crc%
if errorlevel 1 if not "%aspi_nobld%"=="1" goto _bldnic
:_no16dir
:_pre2
echo ASPI: Using pre-built ASPI index from drive %srcdrv%
if exist %ramdrv%\bin\repci.bat goto _xrepci
if not exist %ramdrv%\etc\_aspi.nic goto _nq16nic
type %ramdrv%\etc\_aspi.nic >>%tmp%\_aspi.nic
:_nq16nic
:_nqnic
if not exist %ramdrv%\etc\_aspi.pci goto _xr16pci
type %ramdrv%\etc\_aspi.pci >>%tmp%\_aspi.pci
:_xr16pci
goto _xrepcix
:_xrepci
if not exist %ramdrv%\etc\_aspi.pci goto _xg16pci
echo ASPI: Loading ASPI SCSI index
call repci.bat %ramdrv%\etc\_aspi.pci %tmp%\_aspi.pci %tmp%\_aspi.nic
:_xg16pci
:_xrepcix
if not exist %tmp%\_aspi.* %0 : failed to create ';%tmp%\_aspi.*';
goto _nic2
:_bldnic
echo ASPI: Building ASPI SCSI list from plug-ins
for %%i in (%tmp%\_aspi.nic %tmp%\_aspi.pci) do if exist %%i del %%i >nul
if not exist %srcdrv%\lib\aspi\*.%arcext% goto _ndo16x
if exist %tmp%\_aspi.pci del %tmp%\_aspi.pci >nul
if exist %tmp%\_aspi.nic del %tmp%\_aspi.nic >nul
for %%i in (%srcdrv%\lib\aspi\*.%arcext%) do call %0 : _addnic %%i
echo ASPI: Loading ASPI SCSI index
if exist %ramdrv%\bin\repci.bat call repci.bat %tmp%\_aspi.pci %tmp%\_aspi.pci %tmp%\_aspi.nic
echo ASPI: Generating 32 bits CRC
dir %srcdrv%\lib\aspi\*.%arcext% | tfind /F10,3 "cab" >%tmp%\_aspi.tm2
crc32 %tmp%\_aspi.tm2 >%tmp%\_aspi.crc
:_ndo16x
if "%aspi_nosav%"=="1" goto _gddjkl
goto _savdrv
if not exist %ramdrv%\bin\ettool.com goto _savdrv
ettool.com -e -s
if errorlevel 255 %0 : _error ettool.com 255
if errorlevel 1 goto _oncd2
goto _savdrv
:_oncd2
echo ASPI: Booted from CD-Rom, where to put pre-built index?
wbat box @%0:w_ramdrv
if errorlevel 4 goto _nic2
if errorlevel 1 set wbat=%ramdrv%
if errorlevel 2 set wbat=a:
if errorlevel 3 set wbat=b:
:_oncd3
echo ASPI: Copying to %wbat%
if not exist %wbat%\Etc\*.* mkdir %wbat%\Etc
if not exist %tmp%\_aspi.pci goto _podr16
lmod ; []<%tmp%\_aspi.crc >%wbat%\etc\_aspi.pci
type %tmp%\_aspi.pci >>%wbat%\etc\_aspi.pci
if exist %wbat%\etc\_aspi.crc del %wbat%\etc\_aspi.crc >nul
if "%ramdrv%"=="%wbat%" goto _podr16
type %wbat%\etc\_aspi.pci >%ramdrv%\etc\_aspi.pci
:_podr16
if exist %ramdrv%\bin\repci.bat goto _nic2
if not exist %tmp%\_aspi.nic goto _podr16z
type %tmp%\_aspi.nic >%wbat%\etc\_aspi.nic
type %tmp%\_aspi.nic >%ramdrv%\etc\_aspi.nic
:_podr16z
goto _nic2
:_savdrv
:_gddjkl
if exist %ramdrv%\bin\repci.bat goto _podr16y
if not exist %tmp%\_aspi.nic goto _podr16y
type %tmp%\_aspi.nic >%ramdrv%\etc\_aspi.nic
:_podr16y
for %%i in (%ramdrv%\etc\_aspi.*) do if exist %%i del %%i >nul
if not exist %tmp%\_aspi.pci goto _podr16q
lmod ; []<%tmp%\_aspi.crc >%ramdrv%\etc\_aspi.pci
type %tmp%\_aspi.pci >>%ramdrv%\etc\_aspi.pci
if "%aspi_nosav%"=="1" goto _podr16q
echo ASPI: About to copy ASPI index to %srcdrv% for faster boot next time
echo ASPI: Skip this by hitting [Cancel] in the write protection dialog
set t_out=1
set t_def=1
call drd.bat %srcdrv%
if errorlevel 11 set t_out=0
if errorlevel 12 set t_out=1
if errorlevel 12 set t_def=2
wbat box @%0:w_wprot &#35;%t_def%,%t_out%
set t_out=
set t_def=
if errorlevel 2 goto _nic2
if not exist %srcdrv%\Etc\*.* mkdir %srcdrv%\Etc
for %%i in (%srcdrv%\etc\_aspi.*) do if exist %%i del %%i >nul
type %ramdrv%\etc\_aspi.pci >%srcdrv%\etc\_aspi.pci
if exist %srcdrv%\etc\_aspi.crc del %srcdrv%\etc\_aspi.crc >nul
if exist %ramdrv%\bin\repci.bat goto _podr16q
if not exist %tmp%\_aspi.nic goto _podr16q
type %tmp%\_aspi.nic >%srcdrv%\etc\_aspi.nic
:_podr16q
:_nic2
echo. >>%tmp%\_aspi.pci
echo ; This file is used to manual>%tmp%\_aspi.bak
echo ; select a ASPI SCSI driver>>%tmp%\_aspi.bak
echo :_lan "Select ASPI driver..." [x]>>%tmp%\_aspi.bak
echo ABORT>>%tmp%\_aspi.bak
if not exist %tmp%\_aspi.nic goto _ngth16
type %tmp%\_aspi.nic >>%tmp%\_aspi.bak
:_ngth16
type %tmp%\_aspi.bak >%tmp%\_aspi.nic
set pci0=
tfind /e "ret=" <%tmp%\_aspi.pci >nul
if errorlevel 2 goto _2nicok
if errorlevel 1 goto _1nicok
if errorlevel 0 %0 : _error No ASPI driver(s) found...
:_1nicok
goto _2nicok
tfind "ret=" <%tmp%\_aspi.pci | lmod set wbat=[&#36;2]>%tmp%\_aspi.bat
set wbat=
call %tmp%\_aspi.bat
echo ASPI: Auto selecting the only ASPI driver found (%wbat%)
set pci0=%wbat%
set wbat=
goto _pciok
:_2nicok
:_nicprompt
:_auto
if "%aspi_mode%"=="3" goto _aspi3
echo ASPI: PCI ASPI adapter detection...
for %%i in (0 1 2 3 4) do set pci%%i=
if exist %ramdrv%\bin\getpci.exe if exist %ramdrv%\bin\repci.bat goto _getpci
if exist %ramdrv%\bin\pciscan.exe goto _pciscan
goto _manual
:_getpci
call repci.bat : _pnp %tmp%\_aspi.pci
goto _pcipnp
:_pciscan
pciscan.exe -s -u -d -x %tmp%\_aspi.pci
if errorlevel 1 goto _pcifailed
echo %pci0% * >%tmp%\_aspi.bak
lmod @set _aspi=[&#36;1]<%tmp%\_aspi.bak >%tmp%\_aspi.bat
call %tmp%\_aspi.bat
if not "%_aspi%"=="" if not "%_aspi%"=="*" goto _pciok
goto _tryisa
:_tryisa
if not "%aspi_autoisa%"=="1" goto _0isa
tfind "dev=" <%tmp%\_aspi.pci | tfind /e "BAD " >nul
if errorlevel 2 goto _0isa
if errorlevel 1 goto _1isa
goto _0isa
:_1isa
tfind "=" <%tmp%\_aspi.pci >%tmp%\_aspi.bak
if exist %tmp%\_aspi.tmp del %tmp%\_aspi.tmp >nul
:_isalop
lmod [] <%tmp%\_aspi.bak >>%tmp%\_aspi.tmp
tfind "dev=" <%tmp%\_aspi.tmp | tfind /e "BAD " >nul
if errorlevel 1 goto _isaloop
linex 2- <%tmp%\_aspi.bak >%tmp%\_aspi.dum
type %tmp%\_aspi.dum >%tmp%\_aspi.bak
goto _isalop
:_isaloop
tfind "dev=" <%tmp%\_aspi.tmp | lmod [] | tfind /e "BAD " >nul
if errorlevel 1 goto _okisa
linex 2- <%tmp%\_aspi.tmp >%tmp%\_aspi.bak
type %tmp%\_aspi.bak >%tmp%\_aspi.tmp
goto _isaloop
:_okisa
tfind "ret=" <%tmp%\_aspi.tmp | lmod set wbat=[&#36;2]>%tmp%\_aspi.bat
set wbat=
call %tmp%\_aspi.bat
if "%wbat%"=="" goto _0isa
echo ASPI: No PCI match: Auto selecting single non-PCI ASPI driver (%wbat%)
set pci0=%wbat%
set wbat=
goto _pciok
:_0isa
:_pcifailed
if "%aspi_no2manual%"=="1" goto _wder
goto _aws
:_wder
echo ASPI: PCI detection has failed to detect an ASPI adapter.
goto _end
:_aws
echo ASPI: PCI detection has failed, Switching to manual!
:_aspi3
:_manual
lmod /L* [1,76] <%tmp%\_aspi.nic >>%tmp%\_aspi.tmp
if "%aspi_no2abort%"=="1" goto _aped
call w.bat list @%tmp%\_aspi.tmp:_lan &#35;1,%aspi_ti%
goto _apoek
:_aped
call w.bat list @%tmp%\_aspi.tmp:_lan &#35;1
:_apoek
echo %wbat% * >%tmp%\_aspi.bak
lmod @set _aspi=[&#36;1]<%tmp%\_aspi.bak >%tmp%\_aspi.bat
call %tmp%\_aspi.bat
if "%_aspi%"=="*" %0 : _error No ASPI driver selected ...
echo %wbat% >%tmp%\_aspi.bak
lmod set pci0=[&#36;1]<%tmp%\_aspi.bak >%tmp%\_aspi.bat
call %tmp%\_aspi.bat
set wbat=
if "%pci0%"=="ABORT" goto _end
:_pciok
set w_ok=
echo %pci0% >%tmp%\_nwlan.bak
lmod set pci0=[&#36;1]<%tmp%\_nwlan.bak >%tmp%\_nwlan.bat
call %tmp%\_nwlan.bat
if "%pci0%"=="" goto _end
if not "%aspi_mode%"=="1" goto _back1
if "%aspi_last%"=="%pci0%" goto _back1
set aspi_last=%pci0%
goto _sav1
:_back1
echo ASPI: Extracting driver file "%pci0%"
if exist %ramdrv%\lib\aspi\%pci0%.sys goto _unpok
if not exist %ramdrv%\lib\nul mkdir %ramdrv%\lib >nul
if not exist %ramdrv%\lib\aspi\nul mkdir %ramdrv%\lib\aspi >nul
if not exist %ramdrv%\lib\aspi\%pci0%.%arcext% goto _fromsrc
call unpack.bat %ramdrv%\lib\aspi\%pci0%.%arcext% lib\aspi\ lib\aspi\
if not "%unpackerr%"=="" %0 : _error extracting ';%ramdrv%\lib\aspi\%pci0%.%arcext%';
goto _unpok
:_fromsrc
if not exist %srcdrv%\lib\aspi\%pci0%.%arcext% goto _ramjoin
call unpack.bat %srcdrv%\lib\aspi\%pci0%.%arcext% lib\aspi\ lib\aspi\
if not "%unpackerr%"=="" %0 : _error extracting ';%srcdrv%\lib\aspi\%pci0%.%arcext%';
goto _unpok
:_ramjoin
if not exist %ramdrv%\lib\aspi\joinaspi.%arcext% goto _srcjoin
call unpack.bat %ramdrv%\lib\aspi\joinaspi.%arcext% lib\aspi\ lib\aspi\
if not "%unpackerr%"=="" %0 : _error extracting ';%ramdrv%\lib\aspi\joinaspi.%arcext%';
goto _unpok
:_srcjoin
if not exist %srcdrv%\lib\aspi\joinaspi.%arcext% goto _src2nd
call unpack.bat %srcdrv%\lib\aspi\joinaspi.%arcext% lib\aspi\ lib\aspi\
if not "%unpackerr%"=="" %0 : _error extracting ';%srcdrv%\lib\aspi\joinaspi.%arcext%';
goto _unpok
:_src2nd
%0 : _error cannot find ';%pci0%.%arcext%';
:_unpok
set nbi0=
if not exist %ramdrv%\lib\aspi\%pci0%.bat goto _noautorun
%ramdrv%
cd \lib\aspi
call %ramdrv%\lib\aspi\%pci0%.bat
cd \
goto _cleanup
:_noautorun
if not exist %ramdrv%\lib\aspi\%pci0%.sys %0 : _error missing ASPI ';%ramdrv%\lib\aspi\%pci0%.sys';
call devhigh %ramdrv%\lib\aspi\%pci0%.sys
if errorlevel 1 goto _abort
goto _cleanup
:_cleanup
goto _nicok
:_addnic
if exist %ramdrv%\scsi.isa del %ramdrv%\scsi.isa >nul
if exist %ramdrv%\scsi.pci del %ramdrv%\scsi.pci >nul
if exist %ramdrv%\scsi.txt del %ramdrv%\scsi.txt >nul
if exist %tmp%\scsi.isa del %tmp%\scsi.isa >nul
if exist %tmp%\scsi.pci del %tmp%\scsi.pci >nul
if exist %tmp%\scsi.txt del %tmp%\scsi.txt >nul
if exist %tmp%\aspi.isa del %tmp%\aspi.isa >nul
if exist %tmp%\aspi.pci del %tmp%\aspi.pci >nul
if exist %tmp%\aspi.txt del %tmp%\aspi.txt >nul
call unpack.bat %3 .\ .\ scsi.*
if not "%unpackerr%"=="" %0 : _error extracting ';%3';
if not exist %ramdrv%\scsi.isa goto _hhisa
type %ramdrv%\scsi.isa >%tmp%\aspi.isa
del %ramdrv%\scsi.isa >nul
:_hhisa
if not exist %ramdrv%\scsi.pci goto _hhpci
type %ramdrv%\scsi.pci >%tmp%\aspi.pci
del %ramdrv%\scsi.pci >nul
:_hhpci
if not exist %ramdrv%\scsi.txt goto _hhtxt
type %ramdrv%\scsi.txt >%tmp%\aspi.txt
del %ramdrv%\scsi.txt >nul
:_hhtxt
if not exist %tmp%\aspi.txt goto _lantxt
type %tmp%\aspi.txt >>%tmp%\_aspi.nic
:_lantxt
if not exist %tmp%\aspi.pci goto _lanpci
xgrep -sv "^[:s]*;" %tmp%\aspi.pci >>%tmp%\_aspi.pci
:_lanpci
if not exist %tmp%\aspi.isa goto _lanisa
xgrep -sv "^[:s]*;" %tmp%\aspi.isa >>%tmp%\_aspi.pci
:_lanisa
if exist %tmp%\aspi.isa del %tmp%\aspi.isa
if exist %tmp%\aspi.pci del %tmp%\aspi.pci
if exist %tmp%\aspi.txt del %tmp%\aspi.txt
goto _eof
:_nolan
%0 : _error No driver files found on %srcdrv% (%srcdrv%\lib\aspi\*.%arcext%)
:_nicok
goto _end
:_config
echo :w_config "ASPI configuration" [x]>%tmp%\_aspi.tmp
echo.>>%tmp%\_aspi.tmp
echo Dialog timeout [&#36; aspi_ti,3] seconds.>>%tmp%\_aspi.tmp
echo.>>%tmp%\_aspi.tmp
echo [!] Skip "Run ASPI or go config?" dialog>>%tmp%\_aspi.tmp
echo.>>%tmp%\_aspi.tmp
echo.>>%tmp%\_aspi.tmp
echo   Aspi Adapter Selection Mode: >>%tmp%\_aspi.tmp
echo.>>%tmp%\_aspi.tmp
echo   [.] Last-Used Aspi Adapter (';%aspi_last%';) >>%tmp%\_aspi.tmp
echo       [!] Select ';Autodetect'; if empty >>%tmp%\_aspi.tmp
echo.>>%tmp%\_aspi.tmp
echo   [.] Autodetect Aspi Adapter >>%tmp%\_aspi.tmp
echo       [!] Select ';Manual'; if failed >>%tmp%\_aspi.tmp
echo.>>%tmp%\_aspi.tmp
echo   [.] Manual Aspi Adapter from List >>%tmp%\_aspi.tmp
echo       [!] Select ';Abort'; if Timeout >>%tmp%\_aspi.tmp
echo.>>%tmp%\_aspi.tmp
echo   [.] Abort (Skip Aspi Adapter) >>%tmp%\_aspi.tmp
echo. >>%tmp%\_aspi.tmp
echo. >>%tmp%\_aspi.tmp
echo           [ Save ]  [? Cancel ]>>%tmp%\_aspi.tmp
set wcb1=%aspi_ncfg%
set wcb2=1
set wcb3=1
set wcb4=1
if "%aspi_no2auto%"=="1" set wcb2=
if "%aspi_no2manual%"=="1" set wcb3=
if "%aspi_no2abort%"=="1" set wcb4=
set wrb=2
for %%i in (1 2 3 4) do if "%%i"=="%aspi_mode%" set wrb=%%i
call w.bat box @%tmp%\_aspi.tmp:w_config
if errorlevel 2 goto _end
set aspi_mode=%wrb%
set aspi_ncfg=%wcb1%
set aspi_no2auto=0
set aspi_no2manual=0
set aspi_no2abort=0
if not "%wcb2%"=="1" set aspi_no2auto=1
if not "%wcb3%"=="1" set aspi_no2manual=1
if not "%wcb4%"=="1" set aspi_no2abort=1
:_sav1
call saveset.bat ASPI
echo.
if "%pci0%"=="" goto _start
if not "%pci0%"=="" goto _back1
:w_cfg " Run ASPI or go config? " [x]
                      (~press any key~: &#35;? sec.)
  Installing Aspi SCSI Support (Mode: %aspi_mode%) ...
  1: Last, 2: Auto, 3: Manual, 4: Abort
         [ Ok ] [ Config ] [? Abort ]
::
:w_wprot "Disable write protection..." [x]
  If the disk in drive %srcdrv% is write
  protected, please disable the write
  protection now in order to save settings.
  You can re-enable write protection after
  saving.
            [ Ok ]  [? Cancel ]
::
:_usage
echo Parameters:
echo -c    Config mode
echo -h    This help info
echo.
echo _end
:_error
shift
shift
echo.
echo ASPI (error) %1 %2 %3 %4 %5 %6 %7 %8
echo.
@rem pause
goto _end
:_abort
echo ASPI: Aborted...
echo.
@rem pause
:_end
set | tfind /f1,2 "W_" >%tmp%\_aspi.tmp
set | tfind /f1,5 "ASPI_" >>%tmp%\_aspi.tmp
type %tmp%\_aspi.tmp | lmod /L* /B= set [&#36;1]=>%tmp%\_aspi.bat
call %tmp%\_aspi.bat
for %%i in (%tmp%\_aspi.*) do if exist %%i del %%i >nul
set ?=
set wcb1=
set wcb2=
set wcb3=
set wcb4=
set wcb5=
set wcb6=
set wcb7=
set wcb8=
set wcb9=
set wrb=
set wbat=
for %%i in (0 1 2 3 4) do set pci%%i=
set _aspi=
:: Aspi End ::
:_eof
老外写起批处理来真的不是盖的,巨认真。这个还不算,看看Bart的启动盘中
那个批处理,四十几KB,眼睛都看花了!
国内的像MAXDOS什么的,根本没在批处理上花什么功夫,
回复

使用道具 举报

3#
 楼主| 发表于 2006-3-21 00:15:27 | 只看该作者

DOS 中怎样使用USB设备

[这个贴子最后由我是神仙在 2006/03/21 00:57am 第 1 次编辑]

@echo off
if not [%debug%]==[] echo on
if [%1]==[:] if not [%2]==[] goto %2
if [%1]==[/?] %0 : _usage
rem if not exist protman&#36; %0 : _canceled No pkt or ndis found !
if [%RAMDRV%]==[] %0 : _canceled No RAMDRV found !
if not exist %ramdrv%\rubik\ghost.exe %0 : _canceled ghost.exe not found!
call %0 : _push-path
:_begin
call %0 : _getip %1 %2 %3 %4
if %?%==100 %0 : _canceled user abort
call %0 : _wattcp
call %0 : _netghost
if errorlevel 1 goto _try-again
call %0 : _done
%0 : _pop-path
:_try-again
call %0 : _error
goto _begin
goto _end
:_usage
echo.
echo  Usage:   you can provide session name or ip after batch command
echo.
echo    e.g.     NetGhost mySessionName
echo              NetGhost mySessionName dhcp
echo              NetGhost mySessionName ip
echo              NetGhost mySessionName ip netmask gateway
echo.
echo usage
pause
goto _end
:_canceled
echo  %3 %4 %5 %6 %7 %8 %9
echo  NetGhost canceld
goto _end
:_push-path
set p_dir=
if exist %ramdrv%\rubik\nset.com goto _save
echo  nset.com not found !
goto _end
:_save
cd|nset p_dir=&#36;1
%ramdrv%
cd \rubik
goto _end
:_pop-path
if not exist nset.com goto _end
%p_dir%\
cd %p_dir%
goto _end
:_getip
if not [%3]==[] set p_ghost=%3
if not [%4]==[] set p_ip=%4
if not [%5]==[] set p_netmask=%5
if not [%6]==[] set p_gateway=%6
if "%p_netmask%" == "" set p_netmask=255.255.255.0
if "%p_gateway%" == "" set p_gateway=192.168.0.1
if "%p_ghost%" == "" set p_ghost=rubik
if not [%4]==[] goto _getip-wbat
if exist random.com if exist nset.com goto _getip-random
if not exist random.com echo random.com not found!
if [%p_ip%]==[] set p_ip=192.168.0.241
goto _getip-wbat
:_getip-random
random 2 254|nset p_random=&#36;1
set p_ip=192.168.0.%p_random%
:_getip-wbat
if exist wbat.com if exist w.bat goto _getip-box
if not exist wbat.com echo  wbat.com not found!
if not exist w.bat echo  w.bat not found!
goto _end
:_getip-box
set p_timeout=60
if not [%4]==[] set p_timeout=3
set wrb=1
if [%p_dhcp%]==[] set wrb=2
if [%4]==[dhcp] set wrb=2
if [%4]==[DHCP] set wrb=2
call w.bat fix box @%0:_w-getip &#35;7,%p_timeout%
if %wrb%==1 if [%p_ip%]==[] goto _getip
if %wrb%==1 if [%p_netmask%]==[] goto _getip
set p_dhcp=%wrb%
goto _end
:_wattcp
if not [%p_dhcp%]==[1] goto _dhcp
echo IP=%p_ip%>WATTCP.CFG
echo NETMASK=%p_netmask%>>WATTCP.CFG  
echo GATEWAY=%p_gateway%>>WATTCP.CFG
goto _end
:_dhcp
if [%p_dhcp%]==[] set [%p_dhcp%]=1
if exist WATTCP.CFG del WATTCP.CFG
goto _end
:_netghost
wbat cursor 18+7
echo  Loading Symantec Ghost 8.2   ...
if [%p_ghost%]==[] goto _no-session
echo  Session to connect is : %p_ghost%
wbat cursor 25
wbat save 1
wbat box 24,2 yes
pause>nul
ghost -ja=%p_ghost% -batch
if errorlevel 1 %0 : _canceled netghost
goto _end
:_no-session
echo  No session provided.Select Menu-MultiCast yourself .
wbat cursor 25
wbat save 1
pause>nul
ghost
if errorlevel 1 %0 : _canceled netg no
goto _end
:_done
wbat restore 1
wbat cursor 20+5
pause>nul
echo  NetGhost done. Congratulation!
goto _end
:_error
wbat restore 1
wbat cursor 20+5
pause>nul
if Not [%p_dhcp%]==[1] echo  Error with DHCP. Change IP and try again ... ...
if [%p_dhcp%]==[1] echo  Error with IP %p_ip%. Change IP and try again ... ...
goto _end

:_w-getip "Ghost MultiCast Parameters" [x]
                                 ( ~&#35;?~ sec.)
[.] Use static IP
     IP address   : [&#36; p_ip,15     ]%p_noip%
     Subnet Mask  : [&#36; p_netmask,15]%p_noip%
     Gateway      : [&#36; p_gateway,15]
[.] Enable DHCP
  * IP is NOT used when DHCP enabled
  GhostSrv session name : [&#36; p_ghost,12]
       [ OK ]    [? Cancel ]
:reset
set p_dir=
set p_dhcp=
set p_ip=
set p_netmask=
set p_gateway=
set p_ghost=
set p_noip=
set p_random=
set p_timeout=
set wrb=
set wbat=
set ?=
goto _end
:_end

================
if exist PROTMAN&#36; if not exist PKTDRV&#36; %0 : _error MsClient packet driver missing (MSNET)
if not exist %ramdrv%\bin\pktchk.com goto _npktchk
%ramdrv%\bin\pktchk.com 0x20 0xff >nul
if errorlevel 1 %0 : _error missing packet driver
:_npktchk
回复

使用道具 举报

4#
 楼主| 发表于 2006-3-21 00:23:05 | 只看该作者

DOS 中怎样使用USB设备

DOS中加载光驱,看到这个批处理,真的晕了

@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
echo CDROM: Starting (version 2.2)
:_start
call readset.bat CDROM
:_noset
if "%cdrom_ti%"=="" set cdrom_ti=10
if "%1"=="-c" goto _config
if "%1"=="/c" goto _config
if "%1"=="-h" goto _usage
if "%1"=="/h" goto _usage
if not "nwcache.exe"=="%cache%" goto _okq
echo.
echo CDROM: loading driver aborted
echo.
echo CD-ROM driver should be loaded before cache nwcache.exe.
echo Nwcache.exe is already loaded. To prevent this next time,
echo please move nwcache.%arcext% to dir \level2\.
echo.
@pause
goto _end
:_okq
if "%cdrom_ncfg%"=="1" goto _nocfg
set wcb1=%cdrom_install%
call w.bat box @%ramdrv%\bin\cdrom.bat:w_cfg &#35;2,%cdrom_ti%
if errorlevel 3 goto _end
set cdrom_install=%wcb1%
if errorlevel 2 goto _config
:_nocfg
if "%cdrom_install%"=="1" goto _dothecd
echo CDROM: Skipping CDROM
goto _end
:_dothecd
if exist CDEXUSB1 goto _notagain
if exist CDEXELT1 goto _notagain
if exist CDEXATA1 goto _notagain
if exist CDEXSCS1 goto _notagain
if "%cdrom_ld%"=="5" goto _fixed
if "%cdrom_ld%"=="4" goto _manual
goto _auto
:_manual
echo CDROM: Manual loading mode
echo :w_manual "Manual CD-Rom configuration?" [x]>%tmp%\_cdrom.tmp
echo.>>%tmp%\_cdrom.tmp
:_dmy12
echo [!] Install CDROM >>%tmp%\_cdrom.tmp
echo Use [&#36; cdrom_drv,1,U]: as the first drive letter for CD-Rom>>%tmp%\_cdrom.tmp
echo.>>%tmp%\_cdrom.tmp
echo     [!] Eltorito - requires %srcdrv%\lib\eltorito.%arcext%>>%tmp%\_cdrom.tmp
echo     [!] Atapi    - requires %srcdrv%\lib\atapi.%arcext%>>%tmp%\_cdrom.tmp
:_dmu3
echo         [!] Prefer VIDE-CDD above XCDROM>>%tmp%\_cdrom.tmp
echo     [!] USB      - requires aspiusb.%arcext%>>%tmp%\_cdrom.tmp
echo     [!] Scsi     - requires %srcdrv%\lib\aspi.%arcext% (and more)>>%tmp%\_cdrom.tmp
echo.>>%tmp%\_cdrom.tmp
echo                  [ Ok ]  [? Cancel ]>>%tmp%\_cdrom.tmp
set wcb1=%cdrom_install%
set wcb2=%cdrom_elt%
set wcb3=%cdrom_ata%
set wcb4=%cdrom_vide%
set wcb5=%cdrom_usb%
set wcb6=%cdrom_scs%
call w.bat box @%tmp%\_cdrom.tmp:w_manual
set cdrom_install=%wcb1%
set cdrom_elt=%wcb2%
set cdrom_ata=%wcb3%
set cdrom_vide=%wcb4%
set cdrom_usb=%wcb5%
set cdrom_scs=%wcb6%
if errorlevel 2 goto _end
:_fixed
echo CDROM: Fixed loading mode
if not "%cdrom_elt%"=="1" goto _goatapi
echo CDROM: Loading El-Torito
if exist %ramdrv%\lib\eltorito.sys if "1"=="1" goto _torito2
if not exist %srcdrv%\lib\eltorito.%arcext% %0 : _error missing %srcdrv%\lib\eltorito.%arcext%
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\eltorito.%arcext%
if not "%unpackerr%"=="" goto _abort
:_torito2
call devhigh %ramdrv%\lib\eltorito.sys /D:CDEXELT1
:_goatapi
if not "%cdrom_ata%"=="1" goto _gousb
echo CDROM: Loading Atapi
if exist %ramdrv%\lib\vide-cdd.sys if "1"=="1" goto _fata2
if exist %srcdrv%\lib\atapicd.%arcext% if "%cdrom_vide%"=="1" goto _fata2a
if exist %ramdrv%\bin\xcdrom.sys if "1"=="1" goto _fata2
:_fata2a
if not exist %srcdrv%\lib\atapicd.%arcext% %0 : _error missing %srcdrv%\lib\atapicd.%arcext%
if "%cdrom_ld%"=="2" goto _tryatapi
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\atapicd.%arcext%
if not "%unpackerr%"=="" goto _abort
:_fata2
if not exist %ramdrv%\bin\xcdrom.sys goto _xcd1
if exist %ramdrv%\lib\vide-cdd.sys if "%cdrom_vide%"=="1" goto _xcd1
device %ramdrv%\bin\xcdrom.sys /L /D:CDEXATA1
goto _gousb
:_xcd1
call devhigh %ramdrv%\lib\vide-cdd.sys /D:CDEXATA1
:_gousb
if not "%cdrom_usb%"=="1" goto _goscsi
echo CDROM: Loading USB
if not exist %ramdrv%\bin\usbcd.sys %0 : _error missing %ramdrv%\bin\usbcd.sys
if not exist SCSIMGR&#36; %0 : _error USB ASPI not loaded
call devhigh %ramdrv%\bin\usbcd.sys /D:CDEXUSB1
:_goscsi
if not "%cdrom_scs%"=="1" goto _noscsi2
if exist SCSIMGR&#36; goto _noscsi2
echo CDROM: Loading ASPI/SCSI
if not exist %srcdrv%\lib\aspi\*.%arcext% %0 : _error missing %srcdrv%\lib\aspi\*.%arcext%
if exist %ramdrv%\bin\aspi.bat goto _aspi2
if not exist %srcdrv%\lib\aspi.%arcext% %0 : _error missing file %srcdrv%\lib\aspi.%arcext%
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\aspi.%arcext%
if not "%unpackerr%"=="" goto _abort
:_aspi2
call aspi.bat
if "%pci0%"=="_BACK_" goto _noscsi2
if not exist SCSIMGR&#36; goto _cdex
if exist %ramdrv%\lib\aspicd.sys goto _scsi2
if not exist %srcdrv%\lib\aspicd.%arcext% %0 : _error missing file %srcdrv%\lib\aspicd.%arcext%
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\aspicd.%arcext%
if not "%unpackerr%"=="" goto _abort
:_scsi2
call devhigh %ramdrv%\lib\aspicd.sys /D:CDEXSCS1
:_noscsi2
goto _cdex
:_auto
echo CDROM: Auto mode
if "%cdrom_ld%"=="3" goto _tryatapi
echo CDROM: Trying El-Torito...
if not exist %srcdrv%\lib\eltorito.%arcext% if not exist %ramdrv%\lib\eltorito.sys goto _tryatapi
if not exist %ramdrv%\bin\getargs.com goto _ettool
if "%_ettool%"=="1" goto _ettool
if "%_linux%"=="3" goto _eltorito
:_ettool
if not exist %ramdrv%\bin\ettool.com goto _tryatapi
echo CDROM: Checking boot media type
%ramdrv%\bin\ettool b
if errorlevel 11 goto _tryatapi
if errorlevel 10 goto _eltorito
goto _tryatapi
:_eltorito
if not exist %srcdrv%\lib\eltorito.%arcext% if not exist %ramdrv%\lib\eltorito.sys goto _noeltor
echo CDROM: Loading El-Torito
if exist %ramdrv%\lib\eltorito.sys goto _torito
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\eltorito.%arcext%
if not "%unpackerr%"=="" goto _abort
:_torito
call devhigh %ramdrv%\lib\eltorito.sys /D:CDEXELT1
if "%cdrom_ld%"=="2" goto _tryatapi
if errorlevel 1 goto _abort
goto _cdex
:_noeltor
echo CDROM: File %srcdrv%\lib\eltorito.%arcext% not found.
:_tryatapi
echo CDROM: Trying Atapi...
if exist %ramdrv%\lib\vide-cdd.sys if "1"=="1" goto _atapi1
if exist %srcdrv%\lib\atapicd.%arcext% if "%cdrom_vide%"=="1" goto _atapi1a
if exist %ramdrv%\bin\xcdrom.sys if "1"=="1" goto _atapi1
:_atapi1a
if not exist %srcdrv%\lib\atapicd.%arcext% goto _tryusb
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\atapicd.%arcext%
if not "%unpackerr%"=="" goto _abort
:_atapi1
if not exist %ramdrv%\bin\xcdrom.sys goto _xcd2
if exist %ramdrv%\lib\vide-cdd.sys if "%cdrom_vide%"=="1" goto _xcd2
device %ramdrv%\bin\xcdrom.sys /L /D:CDEXATA1
goto _xcd3
:_xcd2
call devhigh %ramdrv%\lib\vide-cdd.sys /D:CDEXATA1
:_xcd3
if "%cdrom_ld%"=="2" goto _tryusb
if "%cdrom_ld%"=="3" goto _tryusb
if errorlevel 1 goto _tryusb
goto _cdex
:_noatapi
echo CDROM: File %srcdrv%\lib\atapicd.%arcext% not found.
:_tryusb
echo CDROM: Trying USB...
if not exist %ramdrv%\bin\usbcd.sys goto _tryscsi
if not exist SCSIMGR&#36; goto _tryscsi
call devhigh %ramdrv%\bin\usbcd.sys /D:CDEXUSB1
if "%cdrom_ld%"=="2" goto _tryscsi
if "%cdrom_ld%"=="3" goto _tryscsi
if errorlevel 1 goto _tryscsi
goto _cdex
:_tryscsi
if exist SCSIMGR&#36; goto _cdex
echo CDROM: Trying ASPI/SCSI...
if exist %ramdrv%\bin\aspi.bat if "1"=="1" goto _aspi1
if not exist %srcdrv%\lib\aspi.%arcext% goto _cdex
if not exist %srcdrv%\lib\aspi.%arcext% %0 : _error missing file %srcdrv%\lib\aspi.%arcext%
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\aspi.%arcext%
if not "%unpackerr%"=="" goto _abort
:_aspi1
call aspi.bat
if "%pci0%"=="_BACK_" goto _cdex
if not exist SCSIMGR&#36; goto _cdex
if exist %ramdrv%\lib\aspicd.sys goto _scsi1
if not exist %srcdrv%\lib\aspicd.%arcext% goto _noaspicd1
if not exist %srcdrv%\lib\aspicd.%arcext% %0 : _error missing file %srcdrv%\lib\aspicd.%arcext%
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\aspicd.%arcext%
if not "%unpackerr%"=="" goto _abort
:_scsi1
call devhigh %ramdrv%\lib\aspicd.sys /D:CDEXSCS1
:_noaspicd1
:_cdex
if exist CDEXUSB1 goto _cdex1
if exist CDEXELT1 goto _cdex1
if exist CDEXATA1 goto _cdex1
if exist CDEXSCS1 goto _cdex1
echo CDROM: No CD-Rom drivers have been loaded!
goto _abort
:_cdex1
set w_dev=
if exist CDEXELT1 set w_dev=%w_dev% /D:CDEXELT1
if exist CDEXATA1 set w_dev=%w_dev% /D:CDEXATA1
if exist CDEXSCS1 set w_dev=%w_dev% /D:CDEXSCS1
if exist CDEXUSB1 set w_dev=%w_dev% /D:CDEXUSB1
if exist %ramdrv%\bin\mscdex.exe if "%os%"=="ms" goto _msex1
if exist %ramdrv%\bin\shsucdx.*  if "%os%"=="fd" goto _shex1
if exist %ramdrv%\bin\nwcdex.exe if "%os%"=="dr" goto _nwex1
if exist %ramdrv%\bin\mscdex.exe goto _msex1
if exist %ramdrv%\bin\shsucdx.* goto _shex1
if exist %ramdrv%\bin\nwcdex.exe goto _nwex1
if exist %srcdrv%\lib\mscdex.%arcext% if "%os%"=="ms" goto _msex
if exist %srcdrv%\lib\shsucdx.%arcext% if "%os%"=="fd" goto _shex
if exist %srcdrv%\lib\nwcdex.%arcext% if "%os%"=="dr" goto _nwex
if exist %srcdrv%\lib\mscdex.%arcext% goto _msex
if exist %srcdrv%\lib\shsucdx.%arcext% goto _shex
if exist %srcdrv%\lib\nwcdex.%arcext% goto _nwex
echo CDROM: Could not find %srcdrv%\lib\shsucdx.%arcext% or %srcdrv%\lib\mscdex.%arcext%
goto _abort
:_shex
if exist %ramdrv%\bin\shsucdx.* goto _shex1
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\shsucdx.%arcext%
if not "%unpackerr%"=="" goto _abort
:_shex1
:_shex1a
set w_dev=
if "%cachecd%"=="" set cachecd=1024
if not exist CDEXELT1 goto _shex1elt
if not "%cachecd%"=="0" if exist %ramdrv%\bin\cdrcache.sys call devhigh %ramdrv%\bin\cdrcache.sys CDEXELT1 CD&#36;&#36;ELT1 %cachecd%
if exist CD&#36;&#36;ELT1 set w_dev=%w_dev% /D:CD&#36;&#36;ELT1
if not exist CD&#36;&#36;ELT1 set w_dev=%w_dev% /D:CDEXELT1
if not "%cdrom_drv%"=="" if "1"=="1" set w_dev=%w_dev%,%cdrom_drv%
:_shex1elt
if not exist CDEXATA1 goto _shex1ata
if not "%cachecd%"=="0" if exist %ramdrv%\bin\cdrcache.sys call devhigh %ramdrv%\bin\cdrcache.sys CDEXATA1 CD&#36;&#36;ATA1 %cachecd%
if exist CD&#36;&#36;ATA1 set w_dev=%w_dev% /D:CD&#36;&#36;ATA1
if not exist CD&#36;&#36;ATA1 set w_dev=%w_dev% /D:CDEXATA1
if not "%cdrom_drv%"=="" if "1"=="1" set w_dev=%w_dev%,%cdrom_drv%
:_shex1ata
if not exist CDEXSCS1 goto _shex1scs
if not "%cachecd%"=="0" if exist %ramdrv%\bin\cdrcache.sys call devhigh %ramdrv%\bin\cdrcache.sys CDEXSCS1 CD&#36;&#36;SCS1 %cachecd%
if exist CD&#36;&#36;SCS1 set w_dev=%w_dev% /D:CD&#36;&#36;SCS1
if not exist CD&#36;&#36;SCS1 set w_dev=%w_dev% /D:CDEXSCS1
if not "%cdrom_drv%"=="" if "1"=="1" set w_dev=%w_dev%,%cdrom_drv%
:_shex1scs
if not exist CDEXUSB1 goto _shex1usb
if not "%cachecd%"=="0" if exist %ramdrv%\bin\cdrcache.sys call devhigh %ramdrv%\bin\cdrcache.sys CDEXUSB1 CD&#36;&#36;USB1 %cachecd%
if exist CD&#36;&#36;USB1 set w_dev=%w_dev% /D:CD&#36;&#36;USB1
if not exist CD&#36;&#36;USB1 set w_dev=%w_dev% /D:CDEXUSB1
if not "%cdrom_drv%"=="" if "1"=="1" set w_dev=%w_dev%,%cdrom_drv%
:_shex1usb
:_shex1z
shsucdx%w_dev%
if errorlevel 33 goto _abort
if errorlevel 1 if exist %ramdrv%\bin\shsucdx.exe goto _abort
set w_dev=
goto _autorun
:_nwex
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\nwcdex.%arcext%
if not "%unpackerr%"=="" goto _abort
:_nwex1
if not "%cdrom_drv%"=="" set w_dev=%w_dev% /L:%cdrom_drv%
%ldh% nwcdex%w_dev%
if errorlevel 1 goto _abort
set w_dev=
goto _autorun
:_msex
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\mscdex.%arcext%
if not "%unpackerr%"=="" goto _abort
:_msex1
if not "%cdrom_drv%"=="" set w_dev=%w_dev% /L:%cdrom_drv%
%ldh% mscdex%w_dev%
if errorlevel 1 goto _abort
set w_dev=
:_autorun
set cd1=%cdrom_drv%:
if "%cd1%"==":" set cd1=
set | tfind /f1,2 "W_" >>%tmp%\_cdrom.tmp
set | tfind /f1,6 "CDROM_" >>%tmp%\_cdrom.tmp
type %tmp%\_cdrom.tmp | lmod /L* /B= set [&#36;1]=>%tmp%\_cdrom.bat
call %tmp%\_cdrom.bat
if exist %tmp%\_cdrom.* del %tmp%\_cdrom.*
set wcb1=
set wcb2=
set wcb3=
set wcb4=
set wcb5=
set wcb6=
set wcb7=
set wcb8=
set wcb9=
set wrb=
set wbat=
set ?=
if exist %ramdrv%\bin\cdautrun.bat goto _goautrun
if not exist %srcdrv%\lib\cdautrun.%arcext% goto _nocdautrun
call %ramdrv%\bin\unpack.bat %srcdrv%\lib\cdautrun.%arcext%
if not "%unpackerr%"=="" goto _abort
:_goautrun
%ramdrv%\bin\cdautrun.bat
echo CDROM: Eh, did "%ramdrv%\bin\cdautrun.bat" failed?!?
goto _abort
:_nocdautrun
echo CDROM: File "%srcdrv%\lib\cdautrun.%arcext%" not found... autorun disabled.
goto _end
:_config
echo :w_config "CD-Rom configuration" [x]>%tmp%\_cdrom.tmp
echo.>>%tmp%\_cdrom.tmp
echo Dialog timeout [&#36; cdrom_ti,3] seconds.>>%tmp%\_cdrom.tmp
echo [!] Skip "Run CD or go config?" dialog>>%tmp%\_cdrom.tmp
echo.>>%tmp%\_cdrom.tmp
:_dmy12
echo [!] Install CDROM >>%tmp%\_cdrom.tmp
echo Use [&#36; cdrom_drv,1,U]: as the first drive letter for CD-Rom>>%tmp%\_cdrom.tmp
echo.>>%tmp%\_cdrom.tmp
echo Driver loading mode:>>%tmp%\_cdrom.tmp
echo [.] Auto, try to detect best>>%tmp%\_cdrom.tmp
echo [.] Auto, try to detect all>>%tmp%\_cdrom.tmp
echo [.] Auto, try to detect all except Eltorito>>%tmp%\_cdrom.tmp
echo [.] Manual, always ask user>>%tmp%\_cdrom.tmp
echo [.] Fixed, always load:>>%tmp%\_cdrom.tmp
echo     [!] Eltorito - requires %srcdrv%\lib\eltorito.%arcext%>>%tmp%\_cdrom.tmp
echo     [!] Atapi    - requires %srcdrv%\lib\atapi.%arcext%>>%tmp%\_cdrom.tmp
:_dmu3
echo         [!] Prefer VIDE-CDD above XCDROM>>%tmp%\_cdrom.tmp
echo     [!] USB      - requires aspiusb.%arcext%>>%tmp%\_cdrom.tmp
echo     [!] Scsi     - requires %srcdrv%\lib\aspi.%arcext% (and more)>>%tmp%\_cdrom.tmp
echo.>>%tmp%\_cdrom.tmp
echo              [ Save ]  [? Cancel ]>>%tmp%\_cdrom.tmp
set wrb=%cdrom_ld%
set wcb1=%cdrom_ncfg%
set wcb2=%cdrom_install%
set wcb3=%cdrom_elt%
set wcb4=%cdrom_ata%
set wcb5=%cdrom_vide%
set wcb6=%cdrom_usb%
set wcb7=%cdrom_scs%
call w.bat box @%tmp%\_cdrom.tmp:w_config
set cdrom_ld=%wrb%
set cdrom_ncfg=%wcb1%
set cdrom_install=%wcb2%
set cdrom_elt=%wcb3%
set cdrom_ata=%wcb4%
set cdrom_vide=%wcb5%
set cdrom_usb=%wcb6%
set cdrom_scs=%wcb7%
if errorlevel 2 goto _end
call saveset.bat CDROM
echo.
@rem pause
if exist CDEXUSB1 goto _end
if exist CDEXELT1 goto _end
if exist CDEXATA1 goto _end
if exist CDEXSCS1 goto _end
goto _start
:_notagain
echo CDROM: Drivers are already loaded...
goto _autorun
:_noaspi
echo CDROM: No ASPI driver loaded
goto _abort
:_nodrv
echo CDROM: No drivers found. Add Atapi and/or SCSI CD-Rom drivers...
goto _abort
:_no1aspicd
echo CDROM: File not found: %srcdrv%\lib\aspicd.%arcext%
goto _abort
:w_cfg "Run CD or go config?" [x]
        (~press any key~: &#35;? sec.)
  [!] Running CD-Rom...
  [ Ok ] [ Config ] [? Abort ]
::
:w_wprot "Disable write protection..." [x]
  If the disk in drive %srcdrv% is write
  protected, please disable the write
  protection now in order to save settings.
  You can re-enable write protection after
  saving.
            [ Ok ]  [? Cancel ]
::
:_usage
echo Parameters:
echo -c    Config mode
echo -h    This help info
echo.
echo _end
:_error
shift
shift
echo.
echo CDROM: Error %1 %2 %3 %4 %5 %6 %7 %8
echo.
@rem pause
goto _end
:_abort
echo CDROM: Aborted...
echo.
@rem pause
:_end
set | tfind /f1,2 "W_" >>%tmp%\_cdrom.tmp
set | tfind /f1,6 "CDROM_" >>%tmp%\_cdrom.tmp
type %tmp%\_cdrom.tmp | lmod /L* /B= set [&#36;1]=>%tmp%\_cdrom.bat
call %tmp%\_cdrom.bat
if exist %tmp%\_cdrom.* del %tmp%\_cdrom.*
set ?=
set wcb1=
set wcb2=
set wcb3=
set wcb4=
set wcb5=
set wcb6=
set wcb7=
set wcb8=
set wcb9=
set wrb=
set wbat=
回复

使用道具 举报

5#
发表于 2006-3-25 15:49:31 | 只看该作者

DOS 中怎样使用USB设备

怎么用???
不会就把这4个批处理添加进去就好了吧?
回复

使用道具 举报

6#
发表于 2006-3-27 17:48:29 | 只看该作者

DOS 中怎样使用USB设备

看得好晕.
回复

使用道具 举报

7#
发表于 2006-5-11 20:08:32 | 只看该作者

DOS 中怎样使用USB设备

看得我头好晕.啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-11-23 23:52

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表