Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для ArmDeForcer

Старожил


Сообщения: 262
Благодарности: 44

Профиль | Отправить PM | Цитировать


Ясно... никто не может помочь...

Решил проблему так:

Код: Выделить весь код
rem выбираем USB
echo 2. LISTING PHYSICAL DRIVES ON YOUR SYSTEM:
echo ____________________________________________________________________________________
wmic  diskdrive list brief
echo ____________________________________________________________________________________
echo ********************************************
choice /c 0123456789 /m "3. ENTER YOUR USB-DRIVE DeviceID NUMBER (PHYSICALDRIVE#):"
set /a DRVnum=%ERRORLEVEL%-1

rem находим букву USB
echo ********************************************
setlocal EnableDelayedExpansion
set Q='wmic  diskdrive where "Index="%DRVnum%" and Interfacetype="USB""   assoc /assocclass:Win32_DiskDriveToDiskPartition'
for /f "tokens=2,3,4,5 delims=,= " %%a in (%Q%) do (
  set hd=%%a %%b, %%c %%d
  
  call :_LIST_LETTER !hd!)
goto :_next

:_LIST_LETTER
(echo %1 |find  "Disk ") >nul || goto :eof
for /f "tokens=3 delims==" %%a in ('WMIC Path Win32_LogicalDiskToPartition  ^|find %1') do set TMP_letter=%%a
set Part_letter=%TMP_letter:~1,2%
echo 4. YOU CHOOSED DRIVE  %Part_letter% %1
goto :eof

:_next

:eof
Полный скрипт тут:
читать дальше »

Код: Выделить весь код
@echo off
color 16
echo =============================================
echo ^| CREATING WINDOWS 7 INSTALLATION USB-DRIVE ^| 
echo ^|******** by ArmDeForcer (C) 2011 ********* ^|                          
echo ^|********** win72usb.cmd ver. 4 *********** ^|
echo =============================================
echo ********************************************
echo PLEASE FOLLOW THE ONSCREEN INSTRUCTIONS!
echo ********************************************
echo 1. PLUG IN YOUR USB-DRIVE...
pause
echo ********************************************
rem выбираем USB
echo 2. LISTING PHYSICAL DRIVES ON YOUR SYSTEM:
echo ____________________________________________________________________________________
wmic  diskdrive list brief
echo ____________________________________________________________________________________
echo ********************************************
choice /c 0123456789 /m "3. ENTER YOUR USB-DRIVE DeviceID NUMBER (PHYSICALDRIVE#):"
set /a DRVnum=%ERRORLEVEL%-1

rem находим букву USB
echo ********************************************
setlocal EnableDelayedExpansion
set Q='wmic  diskdrive where "Index="%DRVnum%" and Interfacetype="USB""   assoc /assocclass:Win32_DiskDriveToDiskPartition'
for /f "tokens=2,3,4,5 delims=,= " %%a in (%Q%) do (
  set hd=%%a %%b, %%c %%d
  
  call :_LIST_LETTER !hd!)
goto :_next

:_LIST_LETTER
(echo %1 |find  "Disk ") >nul || goto :eof
for /f "tokens=3 delims==" %%a in ('WMIC Path Win32_LogicalDiskToPartition  ^|find %1') do set TMP_letter=%%a
set Part_letter=%TMP_letter:~1,2%
echo 4. YOU CHOOSED DRIVE  %Part_letter% %1
goto :eof

:_next

echo ********************************************
rem проверяем на присутствие файла bootmgr на флешке
rem дабы избежать ошибки циклического копирования
if exist %Part_letter%\bootmgr del %Part_letter%\bootmgr /f  /q
echo 5. INSERT YOUR WINDOWS DISK INTO DVD-DRIVE
pause
echo ********************************************
rem проверяем на присутствие диска и находим букву DVD привода 
for %%i in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\bootmgr set CDROM=%%i:

rem проверяем, существуют ли временный файл с таким именем, если да - стираем
if exist %%temp%%\script.txt del %%temp%%\script.txt /q

echo 6. CREATING TEMP FILE...
rem создаем скрипт
echo select disk %%DRVnum%%>%temp%\script.txt
echo clean>>%temp%\script.txt
echo create partition primary>>%temp%\script.txt
echo select partition 1 >>%temp%\script.txt
echo active>>%temp%\script.txt
echo format fs=NTFS quick>>%temp%\script.txt
echo assign letter=%%Part_letter%%>>%temp%\script.txt
echo exit >>%temp%\script.txt
echo ********************************************
rem подтверждение перед форматированием флешки
echo 7. WARNING! YOUR USB-DRIVE WILL BE FORMATED 
echo TO NTFS FILE SYSTEM AND ALL DATA WILL BE LOST!
choice /C YN /M "ARE YOU SURE YOU WANT TO CONTINUE?:"
if errorlevel=2 Goto ex

:end

rem сам процесс
echo ********************************************
echo 8. WAIT, CREATING A BOOT DRIVE PARTITION...
diskpart /s %temp%\script.txt
echo ********************************************
echo 9. CREATING A PARTITION COMPLETED!
echo ********************************************
echo 10. CREATING BOOT RECORD...
%CDROM%\Boot\bootsect.exe /nt60 %Part_letter% 
echo ********************************************
echo 11. COPYING INSTALLATION FILES TO USB-DRIVE
echo PLEASE WAIT...
rem копируем файлы по тихому
xcopy %CDROM% %Part_letter% /s /e /h /k /q
echo ********************************************
echo 12. DELETING TEMP FILES
echo ********************************************
rem подтираем за собой
del %temp%\script.txt /q
echo ********************************************
echo DONE! YOUR USB-DRIVE IS READY TO USE!
echo PRESS ANY KEY TO FINISH!
echo ********************************************
pause
exit

:ex
del %temp%\script.txt /q
echo ********************************************
echo ERROR! EXITING COMMAND FILE!
echo PRESS ANY KEY TO FINISH!
echo ********************************************
pause
exit

:eof

Отправлено: 13:05, 26-01-2011 | #7