Jump to content

Recommended Posts

Posted

Hello All,

I am having a small problem with getting this to run, i keep getting an error when vmware gets to the part where it runs the runonceex.cmd. A window pops up and says, "Too many command line parimeters".

Any ideas?

Briar

Oh, Here is the code for my runonceex.cmd:

cmdow @ HID

@Echo Off

for /f "tokens=3 skip=2" %%i in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath') do set cddrive=%%~di

SET PP=%cdrom%\$1\Apps\

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

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

REG ADD %KEY%\000 /VE /D "Acrobat Reader 6.0" /f

REG ADD %KEY%\000 /V 1 /D "%PP%AdbeRdr60_enu_full.exe -p"-s /v\"/qn\""" /f

REG ADD %KEY%\001 /VE /D "WinRAR 3.20" /f

REG ADD %KEY%\001 /V 1 /D "%PP%wrar320.exe /s" /f

REG ADD %KEY%\002 /VE /D ".Net Framework 2.0" /f

REG ADD %KEY%\002 /V 1 /D "%PP%dotnetfx.exe /Q" /f

REG ADD %KEY%\003 /VE /D "MDAC 2.8 SP1" /f

REG ADD %KEY%\003 /V 1 /D "%PP%MDAC_28SP1.exe /q /n /q:a" /f

EXIT


Posted (edited)

A couple of things here

1.

for /f "tokens=3 skip=2" %%i in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath') do set cddrive=%%~di

SET PP=%cdrom%\$1\Apps\

^^ Also, if the apps are in '$oem$\$1\Apps' then they will be copied to HDD and can/should be run from there. For that you can more simple use...

set PP=%systemdrive%\Apps\

(no need to use the /for line)

2.

Some unescaped quotes in this line -- this is where your too many parameters error is

REG ADD %KEY%\000 /V 1 /D "%PP%AdbeRdr60_enu_full.exe -p"-s /v\"/qn\""" /f

Edited by nakira
Posted

Thanks for the reply, it stopped saying that it has too many command line parimeters, but it still wont add to the runonceex in the registry.

Here is my code now:

CMDOW @ /HID

@Echo Off

SET PP=%systemdrive%\Apps\

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

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

;REG ADD %KEY%\000 /VE /D "Acrobat Reader 6.0" /f

;REG ADD %KEY%\000 /V 1 /D "%PP%AdbeRdr60_enu_full.exe -p"-s /v\"/qn\""" /f

REG ADD %KEY%\001 /VE /D "WinRAR 3.20" /f

REG ADD %KEY%\001 /V 1 /D "%PP%wrar320.exe /s" /f

REG ADD %KEY%\002 /VE /D ".Net Framework 2.0" /f

REG ADD %KEY%\002 /V 1 /D "%PP%dotnetfx.exe /Q" /f

REG ADD %KEY%\003 /VE /D "MDAC 2.8 SP1" /f

REG ADD %KEY%\003 /V 1 /D "%PP%MDAC_28SP1.exe /q /n /q:a" /f

EXIT

Again thanks for all the help so far.

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

I think HKLM doesn't work ... try with HKCU ....

and for other programs you must use \ before other " symbol ... example: "program.exe with=\"param1\""

With this in the registry you have program.exe with="param1" .... the red quotes is just for encapsule the whole argument of reg add ...

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