Jump to content

Reassigning drive letters automatically


Recommended Posts


If not is there another way around this?
You could execute all the CD program installation at next reboot by calling a batch that (1) will set %CDROM%, and (2) START /WAIT "Installing..." "%CDROM%\app.exe"
Link to comment
Share on other sites

Sorry to revive a dead thread.
This thread is not dead :realmad: you should see download cound which is increasing every day :thumbup

Woah man calm down, it wasnt even in the first 5 pages :} , sorry i offended you - by the thread being so far back i thought devlopment had finished because the tool works and very well, and i thankyou for a great contribution.

You could execute all the CD program installation at next reboot by calling a batch that (1) will set %CDROM%, and (2) START /WAIT "Installing..." "%CDROM%\app.exe"

Right thanks, i can see where you are getting at. Now i have seen such posts about installing on the second boot but cant for the life of me seem to find the via the search, and yeah i tired using "" and +'s and a combination of words.

Will this work?

RunonceEx.cmd

@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

REG ADD %KEY%\002 /VE /D "Adding RunonceEX2.cmd for next reboot" /f
REG ADD %KEY%\002 /V 1 /D "%systemdrive%\Runonce2\Runonce2.cmd" /f

REG ADD %KEY%\003 /VE /D "Rebooting" /f
REG ADD %KEY%\003 /V 1 /D "%systemdrive%\Runonce2\reboot.cmd" /f

Reboot.cmd = a cmd to shut down the computer after say 2 mins

Then

Runonce2.cmd

@echo off
cmdow @ /HID

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

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%\004 /VE /D "Mozilla Firefox 1.0 + Extensions" /f
REG ADD %KEY%\004 /V 1 /D "%CDROM%\Applications\Firefox\Firefox.exe /s" /f
REG ADD %KEY%\004 /V 2 /D "%systemdrive%\install\Applications\Firefox\Setup.exe -MS -IRA" /f
REG ADD %KEY%\004 /V 3 /D "%CDROM%\Applications\Firefox\Profile.exe /s" /f
REG ADD %KEY%\004 /V 4 /D "%systemdrive%\install\Applications\Firefox\Firefox.cmd" /f
REG ADD %KEY%\004 /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

I started RunonceEx2.cmd from 4 as the previous one ended at 3, and dont know if the previous 3 get cleared after a reboot, so just to be safe

Link to comment
Share on other sites

%CDROM%\$OEM$\$1\install\Applications\netframe\netfxsp11.exe

Why install from a CD what you have on your HDD.?

Probably a typo.

Great thread, but I still haven't figured out how to install from CD. Yeah I'm dense.

I don't use use runonce.cmd I use start.cmd.:

CLS
@echo off
TITLE Windows XP SP2 Unattended Installation

ECHO Installing Norton
start /wait %CDROM%\Applications\NAV2003\NAV\NAV.msi /QB

Echo Installing acrobat reader 7
start /wait %CDROM%\Applications\acroread7.exe
 
ECHO Installing Java
start /wait %CDROM%\Applications\j2re.exe /s /v"/qn REBOOT=Suppress ADDLOCAL=ALL IEXPLORER=1 NETSCAPE6=1 MOZILLA=1 JAVAUPDATE=1 WEBSTARTICON=1"


EXIT

The problem is I always get an error saying windows can't find \Applications\.....

So I guess it does't know where %CDROM% is.

any quick advice?

Link to comment
Share on other sites

If I set cdrom to r: it at least gives me a path in the error. now it says R:\Applications\.... could not be found.

Since I know that the cdrom is drive d

I SET CDROM=d:

And everything works perfectly. However when use this on a computer with 2 HDD etc it may not be the d drive.

help....

if I run a cmd that just sets cdrom to r: from cmdlines.txt and then run the installations from my batch at start.cmd will that work?

When does the cdrom have to be set for my batch to work?

SET CDROM=r:

ECHO Installing Norton

start /wait %CDROM%\Applications\NAV2003\NAV\NAV.msi /QB

Link to comment
Share on other sites

put this at the top of your start.cmd

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

and put a file called CD.TXT in the root of your CD before you burn it. Windows looks for CD.txt and sets CDROM to the drive it finds it on :)

Link to comment
Share on other sites

You could execute all the CD program installation at next reboot by calling a batch that (1) will set %CDROM%, and (2) START /WAIT "Installing..." "%CDROM%\app.exe"
Right thanks, i can see where you are getting at. Now i have seen such posts about installing on the second boot but cant for the life of me seem to find the via the search, and yeah i tired using "" and +'s and a combination of words.

Will this work?

RunonceEx.cmd

@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

REG ADD %KEY%\002 /VE /D "Adding RunonceEX2.cmd for next reboot" /f
REG ADD %KEY%\002 /V 1 /D "%systemdrive%\Runonce2\Runonce2.cmd" /f

REG ADD %KEY%\003 /VE /D "Rebooting" /f
REG ADD %KEY%\003 /V 1 /D "%systemdrive%\Runonce2\reboot.cmd" /f

Reboot.cmd = a cmd to shut down the computer after say 2 mins

Then

Runonce2.cmd

@echo off
cmdow @ /HID

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

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%\004 /VE /D "Mozilla Firefox 1.0 + Extensions" /f
REG ADD %KEY%\004 /V 1 /D "%CDROM%\Applications\Firefox\Firefox.exe /s" /f
REG ADD %KEY%\004 /V 2 /D "%systemdrive%\install\Applications\Firefox\Setup.exe -MS -IRA" /f
REG ADD %KEY%\004 /V 3 /D "%CDROM%\Applications\Firefox\Profile.exe /s" /f
REG ADD %KEY%\004 /V 4 /D "%systemdrive%\install\Applications\Firefox\Firefox.cmd" /f
REG ADD %KEY%\004 /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%\115 /VE /D "Cleaning Up and Rebooting" /f
REG ADD %KEY%\115 /V 1 /D "%CDROM%\Applications\Cleanup\clean.cmd" /f

I started RunonceEx2.cmd from 4 as the previous one ended at 3, and dont know if the previous 3 get cleared after a reboot, so just to be safe

You stayed in the same wrong situation! What I meant is a Runonce2.cmd batch like the Solohelp's start.cmd batch:
@echo off
cmdow @ /HID

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

START /WAIT "Mozilla Firefox 1.0 + Extensions" "%CDROM%\Applications\Firefox\Firefox.exe /s"
START /WAIT "..." "%systemdrive%\install\Applications\Firefox\Setup.exe -MS -IRA"
START /WAIT "..." "%CDROM%\Applications\Firefox\Profile.exe /s"
START /WAIT "..." "%systemdrive%\install\Applications\Firefox\Firefox.cmd"
START /WAIT "..." "%systemdrive%\install\Applications\Firefox\Clean.cmd"

START /WAIT "Logitech Setpoint for MX1000" "%CDROM%\Applications\Setpoint\Setpoint-Installer.exe"
START /WAIT "..." "pskill.exe QuickTour2.exe"

START /WAIT "Java 5.1 Runtime" "%CDROM%\Applications\java\java11-Installer.exe /s"
---...---
START /WAIT "Cleaning Up and Rebooting" "%CDROM%\Applications\Cleanup\clean.cmd"

Link to comment
Share on other sites

  • 2 weeks later...
Can this file be ran more eraly in the install? Like at t-39?

YES :thumbup but you should put

CD /D %SystemDrive%\Temp

or something like that in the very beginning of MapDrive.cmd (i.e. before the creation of the 1st temporary file).

ps: I am busy to modify MapDrive.cmd to accept a third parameter to specify a path where the temporary files will be created ;)

Wait some days... :whistle:

Link to comment
Share on other sites

Really i dont understand it very well, So i will display my case and see if i can use your batch.

i have 2 hdd, the hdd of OS has the drive letter G:, i want to reassign it the driver letter C: in a new unattended installation, I can do it? I ask you because i have read that i cant reassign the driver letter that has OS.

Thanks man :thumbup

Link to comment
Share on other sites

Really i dont understand it very well, So i will display my case and see if i can use your batch.

i have 2 hdd, the hdd of OS has the drive letter G:, i want to reassign it the driver letter C: in a new unattended installation, I can do it? I ask you because i have read that i cant reassign the driver letter that has OS.

I think that the system partition letter is assigned automaticaly during the Windows installation: it occurs when you select the target partition when the Windows installation is asking where to install the new system.

So, if your partition is listed as the first one in the possible installation targets, it will automaticaly be assigned to C:. But I supposed this is not your case because your windows is already on G: (and you have only 2 HDD).

I am nearly sure that under NTFS, the partition letters are kept in the partition itself (i.e. on the disk). So, a possible way (this has to be verified) is to install Windows on another partition ("another" = nor C:, nor G:), then modify the letter of the G: to C: (and before, C: to another one (see note below)); then install again Windows but on C: (= was G:). With this way, you do not need MapDrive.cmd.

Note: But perhaps that Windows will not allow you to modify the letter of the boot drive (probably C: except changes in the BIOS). So, it will not be possible to change C: to xxx, and then, G: to C:

Link to comment
Share on other sites

  • 1 month later...

Sorry for kicking this topic, but there's something that I would like to know.

Suppose I have a computer with a DVD+RW and a DVD-ROM. If I create a file "DVD.e" in the root of my system-drive, the program sets both the DVD+RW and the DVD-ROM to E:\.

If I create a second file "DVD.f" it sets them both to F:\.

Is there any way I can avoid this?

PS: I also get this error when testing:

Environment variable TMP_OLD_CDR_VOLUME- not defined

Anyone knows why?

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...