Frank_Sechrist Posted March 21, 2004 Posted March 21, 2004 I have a decent collection of software that I install in an unattended manner from DVD. I do this after an unattended XP Pro install.I'd like to install this software across my LAN from a mapped drive (Drive U: for example). I'd like to modify the .cmd file I currently use to load the unattended install commands into RunOnceEx and have the software install after a restart.I know how to do this, but I do not know how to automatically determine the drive letter and path.I need to determine the drive letter and path 'on the fly' so that I can run the install from DVD, mapped network drive, or local hard drive. Examples are: D:\Install\ZoneAlarm\ZoneAlarmPro.exe /s /noreboot (local hard drive) L:\Install\ZoneAlarm\ZoneAlarmPro.exe /s /noreboot (DVD drive) U:\Install\ZoneAlarm\ZoneAlarmPro.exe /s /noreboot (mapped drive)Is there a way to use a .cmd or script file to determine the drive letter from which the install was started?Thanks.
diesel_98a Posted March 21, 2004 Posted March 21, 2004 u mean something like this? it is @ the beginng of my runonceex.cmdow @ /HID@echo offIF EXIST C:\WIN51IC.SP1 set CDROM=C:IF EXIST D:\WIN51IC.SP1 set CDROM=D:IF EXIST E:\WIN51IC.SP1 set CDROM=E:IF EXIST F:\WIN51IC.SP1 set CDROM=F:IF EXIST G:\WIN51IC.SP1 set CDROM=G:SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /f
Frank_Sechrist Posted March 21, 2004 Author Posted March 21, 2004 I also use this to determine the CD/DVD drive letter, and can use it if necessary, but, I'm trying to find something that will automatically pick up the drive letter and path when I navigate to that location and run the install program.I have 10 network drives mapped, and the install program is on several of them (for backup purposes). I might want to start the install program from a specific mapped drive and have it use that drive after the restart. Also, the install program and files/folders might be in different paths (U:\Install or Z:\AutoInstall\Install).Is there a way for a .cmd file to tell where it is located (drive and path) and pass that as a variable? I don't understand the 'for' command, but suspect that might do it.Thanks.
johann83 Posted March 22, 2004 Posted March 22, 2004 Is there a way for a .cmd file to tell where it is located (drive and path) and pass that as a variable? I don't understand the 'for' command, but suspect that might do it.What about the %CD% environment variable? It holds the directory from where the CMD file is executed. I should think that you would be able to use that to pass to whatever installer etc you need to.Regards,Matt
Frank_Sechrist Posted March 22, 2004 Author Posted March 22, 2004 Matt - Thanks!! This is exactly what I needed. Never heard of the %CD% environment variable, but it works perfectly.Thanks again!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now