HØLLØW Posted November 30, 2008 Posted November 30, 2008 Hey guys,does anyone know how to change the CD-ROM drive letter before my applications will install from the CD?I'm using the following code in my "RunOnceEx.cmd" to install all my stuff from the CD/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:\CD.txt SET CDROM=%%i:The problem is, that the setup is always using the letter D: for the CD-ROM drive but I'd like to assign this letter to my DATA-Partition.
iamtheky Posted December 1, 2008 Posted December 1, 2008 I have lines in my runonceex that call a text document with arguments for diskpart (I assign Z as D is used for my data partition as well). There are probably easier ways, but this way I know exactly when it happens and can easily adjust.REG ADD %REGKEY%\022 /VE /D "changing drive letter" /fREG ADD %REGKEY%\022 /V 22 /D "diskpart /s %path%\chgdrvltr.txt" /f[contents of chgdrvltr.txt]select volume 0assign letter=z noerrexit
HØLLØW Posted December 12, 2008 Author Posted December 12, 2008 (edited) Hey, big thx. It worked very fine in my unattended DVD.I thought, that diskpart is just for disks and not for CD/DVD-ROMs. Edited December 12, 2008 by HØLLØW
jaclaz Posted December 12, 2008 Posted December 12, 2008 Just for the record (and FYI) I just found a way to "feed" diskpart with commands from within the batch (no need for additional file chgdrvltr.txt):http://www.msfn.org/board/index.php?showto...26069&st=19cannot say if a similar approach works with runonceex...jaclaz
iamtheky Posted December 12, 2008 Posted December 12, 2008 Jaclaz thats is very nice. If there are multiple fixed CD/DVD drives is there a way prior to load to determine in which order your script will name them. Im thinking when I have a 2 DVD load (Im at like 3.6GB right now so its coming), running your solution at T-13 from cmdlines.cmd would allow me to access data from a DVD in another tray during the runonce portion if I knew what letter it was getting, further eliminating user tasks.) Or - If I throttle my users to a max of 2 cd/dvd drives, does a second optical drive assume the same volume every time so I could add a second line to the diskpart arguments. All apologies for hijacking your thread, I blame Jaclaz for showing how the cool kids do it. B)
an3k Posted December 12, 2008 Posted December 12, 2008 (edited) just an idea i currently had while reading what you want. why don't you specify the files you have on disc 2 in the DOSNET.INF / LAYOUT.INF where you can specify more discs easily? Never tried that since i use my unattended only in my lan, so i only have the RunOnceEx.cmd called by cmdlines.txt on my disc, everything else (including RunOnceEx1.cmd which is called by RunOnceEx.cmd) is on the network. i create the required network drive with%SYSTEMROOT%\system32\net.exe use T: \\COMPUTERNAME\\SHARENAME PASSWORD /user:COMPUTERNAME\USERNAMEthen i can directly run everything without questions from T:\ - be sure you use this command before you run any command from T:\ otherwise you may get errors.I never tried that too but another idea: can you access files by using the hardware string like \\multi(0)disk(0)rdisk(0)partition(1)\WINDOWS\System32\some.dll? I'm thinking about installing the applications from USB stick, windows itself from CD. Edited December 12, 2008 by an3k
jaclaz Posted December 12, 2008 Posted December 12, 2008 Well if you run diskpart list volume, with one CD/DVD ROM it is always detected as Volume 0, I guess that second CD/DVD ROM will be next. You can read which volumes # are given to a CD device and then "call" the appropriate "couples" of:select volume #assign letter=x noerrexitHere is just an example - just to verify that CD drives are detected correctly, you will need to add yourself the "logic" to assign drive letters.(check also the updated example in the linked thread for ideas on how to find FREE drive letters)@ECHO OFFSETLOCAL ENABLEDELAYEDEXPANSIONSETLOCAL ENABLEEXTENSIONSFOR /F "tokens=1 delims=[]" %%A in ('FIND /N "::THIS IS START OF DISKPART BATCH COMMANDS::" "%~dpnx0"') DO SET More_offset=%%AFOR /F "tokens=*" %%A IN ('ECHO list volume^|diskpart^|FIND "-ROM"') DO (SET LINE=%%ASET token1=!LINE:~7,2!SET token1=!token1: =!REM IF !token1! lss 10 SET token1=0!token1!SET token2=!LINE:~13,1!SET CD_Vol#!token1!=!token2!SET CD_Vols=!CD_Vols! !token2!)SET CD_PAUSEFOR %%A IN (%CD_Vols%) DO (SET /A DP_Line#=%%A*3+%More_offset%FOR /F "tokens=* delims=" %%B IN ('MORE +!DP_Line#! "%~dpnx0"^|diskpart.exe^|FIND "*"') DO (ECHO Active Volume is %%B))GOTO :EOF::THIS IS START OF DISKPART BATCH COMMANDS::select volume 0list volumeEXITselect volume 1list volumeEXITselect volume 2list volumeEXITWhen you blame others, you give up your power to change.Men are only clever at shifting blame from their own shoulders to those of others. jaclaz
iamtheky Posted December 12, 2008 Posted December 12, 2008 It is looking like I get volume 0 and volume 1 consistently when they are on the same cable, but have yet to introduce other devices.-----------------------Both fine quotes, though they lose something when applied to veiled praise.(wow from roman history to the power of positive thinking, quite diverse)I think this one would be more abrasive to those who attempt to genuinely place blame, and as a bonus he was italian too.The sad souls of those who lived without blame and without praise - Durante degli Alighieri (Dante).
jaclaz Posted December 13, 2008 Posted December 13, 2008 Both fine quotes, though they lose something when applied to veiled praise.Yep , but:Praise me not too much, Nor blame me, for thou speakest to the Greeks Who know me.(and NO, that is not Homer Simpson) jaclaz
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now