MSFN Forum: RunonceEx.cmd - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

RunonceEx.cmd RunonceEx.cmd Rate Topic: -----

#1 User is offline   Briar 

  • Newbie
  • Group: Members
  • Posts: 36
  • Joined: 22-April 05

Posted 08 December 2005 - 11:41 AM

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


#2 User is offline   druiddk 

  • Member
  • PipPip
  • Group: Members
  • Posts: 204
  • Joined: 30-November 05

Posted 08 December 2005 - 11:45 AM

I think this:
cmdow @ HID


Should be:
cmdow @ /HID


(If you want it to run hidden that is)

#3 User is offline   nakira 

  • Member
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 18-July 04

Posted 08 December 2005 - 12:41 PM

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

This post has been edited by nakira: 08 December 2005 - 12:42 PM


#4 User is offline   Briar 

  • Newbie
  • Group: Members
  • Posts: 36
  • Joined: 22-April 05

Posted 08 December 2005 - 01:42 PM

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.

#5 User is offline   Sonic 

  • Sonic
  • Group: Patrons
  • Posts: 1,603
  • Joined: 04-December 03

Posted 08 December 2005 - 02:24 PM

View PostBriar, on Dec 8 2005, 08:42 PM, said:

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy