Briar Posted December 8, 2005 Posted December 8, 2005 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?BriarOh, Here is the code for my runonceex.cmd:cmdow @ HID@Echo Offfor /f "tokens=3 skip=2" %%i in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath') do set cddrive=%%~diSET PP=%cdrom%\$1\Apps\SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /fREG ADD %KEY%\000 /VE /D "Acrobat Reader 6.0" /fREG ADD %KEY%\000 /V 1 /D "%PP%AdbeRdr60_enu_full.exe -p"-s /v\"/qn\""" /fREG ADD %KEY%\001 /VE /D "WinRAR 3.20" /fREG ADD %KEY%\001 /V 1 /D "%PP%wrar320.exe /s" /fREG ADD %KEY%\002 /VE /D ".Net Framework 2.0" /fREG ADD %KEY%\002 /V 1 /D "%PP%dotnetfx.exe /Q" /fREG ADD %KEY%\003 /VE /D "MDAC 2.8 SP1" /fREG ADD %KEY%\003 /V 1 /D "%PP%MDAC_28SP1.exe /q /n /q:a" /fEXIT
druiddk Posted December 8, 2005 Posted December 8, 2005 I think this:cmdow @ HIDShould be:cmdow @ /HID(If you want it to run hidden that is)
nakira Posted December 8, 2005 Posted December 8, 2005 (edited) A couple of things here1.for /f "tokens=3 skip=2" %%i in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath') do set cddrive=%%~diSET 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 isREG ADD %KEY%\000 /V 1 /D "%PP%AdbeRdr60_enu_full.exe -p"-s /v\"/qn\""" /f Edited December 8, 2005 by nakira
Briar Posted December 8, 2005 Author Posted December 8, 2005 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 OffSET PP=%systemdrive%\Apps\SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG 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\""" /fREG ADD %KEY%\001 /VE /D "WinRAR 3.20" /fREG ADD %KEY%\001 /V 1 /D "%PP%wrar320.exe /s" /fREG ADD %KEY%\002 /VE /D ".Net Framework 2.0" /fREG ADD %KEY%\002 /V 1 /D "%PP%dotnetfx.exe /Q" /fREG ADD %KEY%\003 /VE /D "MDAC 2.8 SP1" /fREG ADD %KEY%\003 /V 1 /D "%PP%MDAC_28SP1.exe /q /n /q:a" /fEXITAgain thanks for all the help so far.
Sonic Posted December 8, 2005 Posted December 8, 2005 SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExI 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 ...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now