Jump to content

Tell me what is wrong with this. REG ADD ERROR


Recommended Posts

This is how I'd expect it to read:

REG ADD %KEY%\100 /V 1 /D "REG DELETE \"HKLM\Software\Microsoft\Windows NT\CurrentVersion\Print\Printers\,,ipp://dc2.mydomain.com,2F26P\" /F>NUL" /F>NUL

Link to comment
Share on other sites


Also trying to add the following command to the RunOnce in the registry is this correct.

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\KickOff"="rundll32.exe iernonce.dll,RunOnceExProcess"

STOP and READ THIS FIRST: The following code should not be necessary for RunOnceEX to start when Windows is restarted. RunOnceEX is automatically triggered when Windows starts.

RunOnce works a bit differently. No subkeys are used, only values as shown below. RunOnce is triggered automatically when an INF file has finished installing/executing or at Windows start if it has not been run yet.

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /V "KickOff" /D "rundll32.exe iernonce.dll,RunOnceExProcess"

Edited by 5eraph
Link to comment
Share on other sites

Thanks I learn something new every day.

I am trying to do the Adobe updates via reg add

To add this command with REG ADD

start /wait C:\Applications\CS4\Updates\Soundbooth-2.0.1-786\Setup.exe\ --mode=silent

REG ADD %KEY%\040 /VE /D "Installing Adobe CS4 Updates" /f

REG ADD %KEY%\040 /V 1 /D "C:\Applications\CS4\Updates\Soundbooth-2.0.1-786\Setup.exe\ --mode=silent" /f

I tried this but it ended way to fast, also would I need the start /wait with REG add?

Link to comment
Share on other sites

Using the method you suggested earlier in the Topic, does the following work?

REG ADD %KEY%\020 /V 1 /D "\"C:\Applications\CS4\Setup.exe --mode=Silent --deploymentFile=\"C:\Applications\CS4\Adobe Creative Suite 4 Web Premium.install.xml\"\"" /F>NUL

Then with the Updates:

REG ADD %KEY%\040 /V 1 /D "\"C:\Applications\CS4\Updates\Soundbooth-2.0.1-786\Setup.exe --mode=Silent\"" /F>NUL

Additionally, since you don't appear to be installing using the console or a console based application then Start and Wait will make no difference to your installation.

Link to comment
Share on other sites

Does this look ok, because the updates are not installing, it skips over them way to fast.

REG ADD %KEY%\040 /VE /D "Installing Adobe CS4 Updates" /f
REG ADD %KEY%\040 /V 1 /D "\"C:\Applications\CS4\Updates\acrobat9pro-EFG\AcroProStdUpd910_T1T2_incr.msp\" /qn" /F>NUL
REG ADD %KEY%\040 /V 2 /D "\"C:\Applications\CS4\Updates\Updates\acrobat9pro-EFG\AcrobatUpd912_all_incr.msp\" /qn" /F>NUL
REG ADD %KEY%\040 /V 3 /D "\"C:\Applications\CS4\Updates\Updates\acrobat9pro-EFG\AcrobatUpd920_all_incr.msp\" /qn" /F>NUL
REG ADD %KEY%\040 /V 4 /D "\"C:\Applications\CS4\Updates\Fireworks-10.0.3-AdobeUpdate\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 5 /D "\"C:\Applications\CS4\Updates\Photoshop_11.0.2_mul_AdobeUpdate\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 6 /D "\"C:\Applications\CS4\Updates\AdobeDrive_1.0.1_AdobeUpdate_2\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 7 /D "\"C:\Applications\CS4\Updates\AdobeExtensionManager-2.1-mul-AdobeUpdate2\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 8 /D "\"C:\Applications\CS4\Updates\AdobeCameraRaw-5.7-mul-AdobeUpdate\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 9 /D "\"C:\Applications\CS4\Updates\AdobeOutputModule-2.1-mul-AdobeUpdate_2\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 10 /D "\"C:\Applications\CS4\Updates\AdobeVersionCue4All_4.0.1_AdobeUpdate_2\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 11 /D "\"C:\Applications\CS4\Updates\AME_All_CS4.2_mul_AdobeUpdate\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 12 /D "\"C:\Applications\CS4\Updates\DeviceCentral_2.1.1_mul_AdobeUpdate\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 13 /D "\"C:\Applications\CS4\Updates\Flash-10.0.2-AdobeUpdate\Setup.exe --mode=silent\"" /F>NUL
REG ADD %KEY%\040 /V 14 /D "\"C:\Applications\CS4\Updates\Soundbooth-2.0.1-786\Setup.exe --mode=Silent\"" /F>NUL

Link to comment
Share on other sites

Before you do anything else you need to ensure that the commands you want to run are in sequence, they will be run in sequence, not in the order you have written them.

REG ADD %KEY%\040 /VE /D "Installing Adobe CS4 Updates" /f
REG ADD %KEY%\040 /V 1
REG ADD %KEY%\040 /V 10
REG ADD %KEY%\040 /V 11
REG ADD %KEY%\040 /V 12
REG ADD %KEY%\040 /V 13
REG ADD %KEY%\040 /V 14
REG ADD %KEY%\040 /V 2
REG ADD %KEY%\040 /V 3
REG ADD %KEY%\040 /V 4
REG ADD %KEY%\040 /V 5
REG ADD %KEY%\040 /V 6
REG ADD %KEY%\040 /V 7
REG ADD %KEY%\040 /V 8
REG ADD %KEY%\040 /V 9

You need to change your values to include at least one leading zero

REG ADD %KEY%\040 /VE /D "Installing Adobe CS4 Updates" /f
REG ADD %KEY%\040 /V 01
REG ADD %KEY%\040 /V 02
REG ADD %KEY%\040 /V 03
REG ADD %KEY%\040 /V 04
REG ADD %KEY%\040 /V 05
REG ADD %KEY%\040 /V 06
REG ADD %KEY%\040 /V 07
REG ADD %KEY%\040 /V 08
REG ADD %KEY%\040 /V 09
REG ADD %KEY%\040 /V 10
REG ADD %KEY%\040 /V 11
REG ADD %KEY%\040 /V 12
REG ADD %KEY%\040 /V 13
REG ADD %KEY%\040 /V 14

Link to comment
Share on other sites

It would be simpler to use separate IF statements.

If there were a simple numeric progression to the computer names, such as 5B15 to 5B20, then it would be somewhat easy. The hyphen in the first name may add some complexity.

But the progression as given escapes me. Can the hyphen and all characters that follow be ignored in the progression (to check 5B4 to 5B15, for example)?


  • 5B4
    5B5
    5B6
    5B7
    5B8
    5B9
    5B10
    5B11
    5B12
    5B13
    5B14
    5B15

The following code would check my example above:


@ECHO OFF
SETLOCAL EnableDelayedExpansion

::Check the first two characters of %COMPUTERNAME%, if they do not match then skip the range check.
::Otherwise, skip the first two verified characters and set a new variable to parse, then continue.
IF /I "%COMPUTERNAME:~0,2%"=="5B" (
SET "COMPUTERNAME_TO_PARSE=%COMPUTERNAME:~2%"

:: Remove hyphenated portion of %COMPUTERNAME%.
FOR /F "tokens=1 delims=-" %%A IN ("!COMPUTERNAME_TO_PARSE!") DO (SET "COMPUTERNAME_TO_PARSE=%%A")

:: Check numeric range from 4 to 15 with an increment of 1.
FOR /L %%B IN (4,1,15) DO (
IF "!COMPUTERNAME_TO_PARSE!"=="%%B" (
COMMAND 1 GOES HERE
COMMAND 2 GOES HERE
COMMAND 3 GOES HERE
COMMAND 4 GOES HERE
COMMAND X GOES HERE...
) ) )

Edited by 5eraph
Link to comment
Share on other sites

Thanks for your help on this I do appreciate it so much.

Here's the thing. I have to install Adobe CS5 on 15 computers. The standard naming convention we use is 5b4-01 5b4-02 etc. I wish we could ditch the hyphen but I can't. Thanks for all your help again.

Link to comment
Share on other sites

So your list of computers is NOT

5B4-01 TO 5B15

But should be

5B4-01 TO 5B4-15???

If so, then it should be VERY simple to modify 5eraph's script accordingly, ie

Check the first FOUR characters of %COMPUTERNAME%, if they are NOT "5B4-" then exit, and if so separate the next two characters into a variable and check to see if they are in the range you require. If not, then exit, and if so continue your install.

Cheers and Regards

Edited by bphlpt
Link to comment
Share on other sites

Correct, bphlpt. We just need to add a leading zero if necessary.

Here's the new code to check 5B4-01 through 5B4-15:

@ECHO OFF
SETLOCAL EnableDelayedExpansion

::Check the first four characters of %COMPUTERNAME%, if they do not match then skip the range check.
::Otherwise, skip the first four verified characters and set a new variable to parse, then continue.
IF /I "%COMPUTERNAME:~0,4%"=="5B4-" (
SET "COMPUTERNAME_TO_PARSE=%COMPUTERNAME:~4%"

:: Check numeric range from 1 to 15 with an increment of 1, add leading zero if necessary.
FOR /L %%B IN (1,1,15) DO (
IF %%B LSS 10 (SET "LEADING_ZERO=0") ELSE (SET "LEADING_ZERO=")

IF "!COMPUTERNAME_TO_PARSE!"=="!LEADING_ZERO!%%B" (
COMMAND 1 GOES HERE
COMMAND 2 GOES HERE
COMMAND 3 GOES HERE
COMMAND 4 GOES HERE
COMMAND X GOES HERE...
) ) )

Link to comment
Share on other sites

I have learned a lot this week from you guys. I know how to do this, check the first FOUR characters of %COMPUTERNAME%, if they are NOT "5B4- then exit. Not quite sure how to do

and if so separate the next two characters into a variable and check to see if they are in the range you require -this yet

But I will try

So your list of computers is NOT

5B4-01 TO 5B15

But should be

5B4-01 TO 5B4-15???

If so, then it should be VERY simple to modify 5eraph's script accordingly, ie

Check the first FOUR characters of %COMPUTERNAME%, if they are NOT "5B4-" then exit, and if so separate the next two characters into a variable and check to see if they are in the range you require. If not, then exit, and if so continue your install.

Cheers and Regards

Edited by clivebuckwheat
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...