Jump to content

RunOnceEx


Recommended Posts

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.

Link to comment
Share on other sites


u mean something like this? it is @ the beginng of my runonceex.

cmdow @ /HID
@echo off

IF 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\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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