Jump to content

Reassigning drive letters automatically


Recommended Posts

Ok, Thanks: now I know that DISKPART could not make a distinction between a CD reader and a CD burner; so I have to find another way (reading registry: can be done but not easy to work on retrieved data).

Stay on the line: I am going to work on it :wacko:

Link to comment
Share on other sites


Hey mdes... I just wanted to let you know that I figured out how to do this pretty easily.... Im using DISKPART with a script that selects volume numbers than assigns the letter....

ie:

diskpart /s drives.txt

drives.txt

select volume 0
 assign letter=I noerr
select volume 1
 assign letter=J noerr
select volume 4
 assign letter=P noerr
select volume 3
 assign letter=D noerr
select volume 5
 assign letter=E noerr

This works like a charm and I have no issues with my CDROM drives as well. Do you still want the info you emailed me about?

Thanks again.

Link to comment
Share on other sites

Hi Durex,

That's just what mapdrive is doing, but automaticaly :P

Do you still want the info you emailed me about?
If you have some minutes to do it: yes, so I will be able to improve my little mapdrive :rolleyes:
Link to comment
Share on other sites

I updated MAPDRIVE.CMD with a new version: see the first post of this thread.

News:

- Correction of something (now, reassignment in nearly 100% working).

- Many DVD & CD could be used instead of only one ot both.

- Drives keeping the same letter, are not de/re-assigned.

- Variables renaming to be more clear.

- Better logfile (with error messages from DISKPART).

- When launched with a parameter, only the log file is created, no de/re-assignement are done (this is for test purpose).

Note:

- The SLEEP.EXE is available in the Windows Server 2003 Resource Kit Tools.

- The corresponding translation of the search string could be found in files "xxx-xxx-csv-WindowsXP.csv" from the Microsoft FTP site.

Happy New Year :)

Link to comment
Share on other sites

  • 1 month later...

Sorry to revive a dead thread. I have been using this command file for my unattended windows Installs with no problems from RunonceEx.

Now, im gonna be using my applications from CD and as durex has pointed out this may prove to be a hurdle, not if we can run the .cmd from cmdlines.txt

Is this possible?

Link to comment
Share on other sites

Thanks but i would like to get this one working. Just so i know the limitations because i have had a small and simple brainstorm.

@echo off
cmdow @ /HID

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY%\001 /VE /D "Drive Letter Assignment" /f
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\MapDrive.cmd ENU >%SystemDrive%\MapDrive.log 2>&1" /f

FOR %%d IN (c: 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 %%d\CD.TXT SET CDROM=%%d

REG ADD %KEY% /V TITLE /D "Installing applications" /f
REG ADD %KEY%\002 /VE /D "Mozilla Firefox 1.0 + Extensions" /f
REG ADD %KEY%\002 /V 1 /D "%CDROM%\Applications\Firefox\Firefox.exe /s" /f
REG ADD %KEY%\002 /V 2 /D "%systemdrive%\install\Applications\Firefox\Setup.exe -MS -IRA" /f
REG ADD %KEY%\002 /V 3 /D "%CDROM%\Applications\Firefox\Profile.exe /s" /f
REG ADD %KEY%\002 /V 4 /D "%systemdrive%\install\Applications\Firefox\Firefox.cmd" /f
REG ADD %KEY%\002 /V 5 /D "%systemdrive%\install\Applications\Firefox\Clean.cmd" /f

REG ADD %KEY%\005 /VE /D "Logitech Setpoint for MX1000" /f
REG ADD %KEY%\005 /V 1 /D "%CDROM%\Applications\Setpoint\Setpoint-Installer.exe" /f
REG ADD %KEY%\005 /V 1 /D "pskill.exe QuickTour2.exe" /f

REG ADD %KEY%\010 /VE /D "Java 5.1 Runtime" /f
REG ADD %KEY%\010 /V 1 /D "%CDROM%\Applications\java\java11-Installer.exe /s" /f

REG ADD %KEY%\012 /VE /D ".NET Framework 1.1 SP1" /f
REG ADD %KEY%\012 /V 1 /D "%CDROM%\$OEM$\$1\install\Applications\netframe\netfxsp11.exe" /f

REG ADD %KEY%\015 /VE /D "Kerio Personal Firewall 4.1.2" /f
REG ADD %KEY%\015 /V 1 /D "%CDROM%\Applications\kpf\kpf412.exe /S /V\"/qn REBOOT=Suppress\"" /f

REG ADD %KEY%\020 /VE /D "WinAmp 5.07" /f
REG ADD %KEY%\020 /V 1 /D "%CDROM%\Applications\winamp\winamp.msi /qb-! INI="%CDROM%\Applications\winamp\winamp.ini"" /f

REG ADD %KEY%\025 /VE /D "WinRar 3.14" /f
REG ADD %KEY%\025 /V 1 /D "%CDROM%\Applications\WinRAR\wrar341.exe /s" /f
REG ADD %KEY%\025 /V 2 /D "REGEDIT /S %CDROM%\Applications\WinRAR\cascade.reg" /f

REG ADD %KEY%\030 /VE /D "MSN Messenger 6.2" /f
REG ADD %KEY%\030 /V 1 /D "%CDROM%\Applications\MSN\MsnMsgs.msi /QB-!" /f
REG ADD %KEY%\030 /V 2 /D "REGEDIT /S %CDROM%\Applications\MSN\msn.reg" /f

REG ADD %KEY%\031 /VE /D "MSN Messenger Plus! 3" /f
REG ADD %KEY%\031 /V 1 /D "%CDROM%\Applications\MSN\MsgPlus3.exe /SilentInstallNoSponsor" /f
REG ADD %KEY%\031 /V 2 /D "pskill.exe MsgPlus.exe" /f
REG ADD %KEY%\031 /V 3 /D "pskill.exe msnmsgr.exe" /f

REG ADD %KEY%\035 /VE /D "Adobe Reader 7.0" /f
REG ADD %KEY%\035 /V 1 /D "%CDROM%\Applications\adbrdr\acroread7s.exe" /f

REG ADD %KEY%\040 /VE /D "ABC BitTorrent Client" /f
REG ADD %KEY%\040 /V 1 /D "%CDROM%\Applications\abc\abc.exe /S" /f

REG ADD %KEY%\045 /VE /D "Media Codecs" /f
REG ADD %KEY%\045 /V 1 /D "%CDROM%\Applications\codecs\codecs.cmd" /f

REG ADD %KEY%\050 /VE /D "Adobe Photoshop CS" /f
REG ADD %KEY%\050 /V 1 /D "%CDROM%\Applications\pscs\AdobeCS-Installer.exe" /f
REG ADD %KEY%\050 /V 2 /D "%CDROM%\Applications\pscs\settings.exe /s" /f

REG ADD %KEY%\055 /VE /D "Scite Source Code Editor" /f
REG ADD %KEY%\055 /V 1 /D "%CDROM%\Applications\scite\scite.exe /VERYSILENT /NORESTART" /f

REG ADD %KEY%\060 /VE /D "GDATA AntiVirus Kit 2004" /f
REG ADD %KEY%\060 /V 1 /D "%CDROM%\Applications\avk\installer.exe" /f

REG ADD %KEY%\065 /VE /D "Direct Connect 0.688" /f
REG ADD %KEY%\065 /V 1 /D "%CDROM%\Applications\directcon\DCPlusPlus.exe /S" /f

REG ADD %KEY%\070 /VE /D "Ahead Nero Ultra 6.3" /f
REG ADD %KEY%\070 /V 1 /D "%CDROM%\Applications\nero\nero.exe" /f

REG ADD %KEY%\075 /VE /D "PerfectDisk 7.0.3" /f
REG ADD %KEY%\075 /V 1 /D "%CDROM%\Applications\PerfectDisk\PD7-Installer.exe" /f

REG ADD %KEY%\080 /VE /D "MicroSoft AntiSpyware Beta 1" /f
REG ADD %KEY%\080 /V 1 /D "%CDROM%\Applications\Msanti\MSAnti-installer.exe" /f

REG ADD %KEY%\085 /VE /D "Net Transport" /f
REG ADD %KEY%\085 /V 1 /D "%CDROM%\Applications\nettrans\NT187.exe /SP /VERYSILENT /NOCANCEL /NORESTART" /f

REG ADD %KEY%\086 /VE /D "Microsoft Office 2003" /f
REG ADD %KEY%\086 /V 1 /D "%CDROM%\Applications\Office\PRO11.msi /QB" /f

REG ADD %KEY%\090 /VE /D "SmartFTP Client" /f
REG ADD %KEY%\090 /V 1 /D "%CDROM%\Applications\smartFTP\SFTPNSI.exe /S" /f

REG ADD %KEY%\095 /VE /D "Skype" /f
REG ADD %KEY%\095 /V 1 /D "%CDROM%\Applications\skype\skypesetup.exe /SP /VERYSILENT /NOCANCEL /NORESTART" /f

REG ADD %KEY%\100 /VE /D "MP3 Tagger 2.77" /f
REG ADD %KEY%\100 /V 1 /D "%CDROM%\Applications\mp3\mp3tag.exe /S" /f

REG ADD %KEY%\105 /VE /D "Driver Cleaner" /f
REG ADD %KEY%\105 /V 1 /D "%CDROM%\Applications\Driverclean\setup.exe /S" /f

REG ADD %KEY%\107 /VE /D "Crap Cleaner 1.17" /f
REG ADD %KEY%\107 /V 1 /D "%CDROM%\Applications\cc\ccsetup117.exe /S" /f

REG ADD %KEY%\110 /VE /D "Removing Startup Items" /f
REG ADD %KEY%\110 /V 1 /D "REGEDIT /S %CDROM%\Applications\Cleanup\starting.reg" /f

REG ADD %KEY%\112 /VE /D "Creating OEM Information" /f
REG ADD %KEY%\112 /V 1 /D "%CDROM%\Applications\Cleanup\oemcreate.cmd" /f

REG ADD %KEY%\115 /VE /D "Cleaning Up and Rebooting" /f
REG ADD %KEY%\115 /V 1 /D "%CDROM%\Applications\Cleanup\clean.cmd" /f

As you can see I have rejiggled my RunonceEx.cmd. If i put mapdrive.cmd in $OEM$\$1\ then it will be copied to C:\. Then if i run it before the command to set my CDROM drive then there should be no problems because the:

FOR %%d IN (c: 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 %%d\CD.TXT SET CDROM=%%d

will pickup the cd drive letter after its been assigned :)

Cant see no problems with this method, can anyone else before i try and implement it?

Link to comment
Share on other sites

Stupid me, of course it wont work.

Its being used in a batch so when the values are written to the regitry then they will contain the wrong variables :(

I know for a fact because i tested it last night and nothing installed.

Please can someone recomend a work around? If this can be run from Cmdlines.txt then i think that will solve it :D but can i run it that early?

If not is there another way around this? Sorry for my urgency but i need to reformat tonoight if possible :P I got my OCZ Rev2's here :)

Link to comment
Share on other sites

New release of MapDrive.cmd

On the system drive, create a DRIVE-.x for each letter x that you don't want to be assigned (= reserved letters for USB Key,...).

See the first post of this thread to download the batch file.

ps: Sorry, but I don't receive the tracking email from this post :realmad:, so, I don't see new email in my pop3 box...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...