I do them directly in programs instead of using a batch file. Like this: 
%systemroot%\sysnative\regedt32 /S HKLMAdminConfig.reg most of the time.

I'm actually surprised though that your msi installs. Pretty sure you don't 
need the \ there either.

http://www.myitforum.com/articles/8/print_view.asp?id=12036


SUMMARY
So, we've learned

1.     When you run a .bat file from a UNC path, the current working directory 
gets set to c:\Windows
2.     %0 evaluates to the full drive, path, filename and extension of the .bat 
file. (%1, %2, etc refer to the params)
3.     %~dp0 evaluates to the drive & path of the current .bat file, 
essentially to what the current working directory WOULD be if UNC paths were 
supported.
4.     %~dp0 includes the trailing backslash so if you're going to use it to 
reference files, use
%~dp0FILENAME.EXE not %~dp0\FILENAME.EXE
or, if you put %~dp0 into a variable called THISDIR, use
%THISDIR%FILENAME.EXE not %THISDIR%\FILENAME.EXE
5.     If your path contains spaces, you'll need quotes around things.




________________________________
        John Marcum
            MCITP, MCTS, MCSA
              Desktop Architect
   Bradley Arant Boult Cummings LLP
________________________________

  [H_Logo]

From: [email protected] [mailto:[email protected]] On 
Behalf Of Heaton, Joseph@Wildlife
Sent: Tuesday, November 24, 2015 1:41 PM
To: '[email protected]' <[email protected]>
Subject: [mssms] RE: Having trouble with this package

Latest correction:

Installed fine on my test machine and my main machine, but not on any others 
that I've tried.  Here's the batch file again:

msiexec /i "%~dp0\Installer.msi" /qn

C:\Windows\sysnative\regedit.exe /s "%~dp0Change.reg"


Could it be the quotes around the reg file?

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Marcum, John
Sent: Tuesday, November 24, 2015 9:20 AM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] RE: Having trouble with this package

Like Daniel said, you command line needs to specify 
"c:\windows\sysnative\regedit.exe"
________________________________
        John Marcum
            MCITP, MCTS, MCSA
              Desktop Architect
   Bradley Arant Boult Cummings LLP
________________________________

  [H_Logo]

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Heaton, Joseph@Wildlife
Sent: Tuesday, November 24, 2015 10:37 AM
To: '[email protected]' 
<[email protected]<mailto:[email protected]>>
Subject: [mssms] RE: Having trouble with this package

The package is 32-bit.  It installs in c:\program files (x86)

Here's the reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ProductX]

[HKEY_LOCAL_MACHINE\SOFTWARE\ProductX\appname]
"company"="Our Company"
"key"="xxxxxxx"

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Daniel Ratliff
Sent: Tuesday, November 24, 2015 8:23 AM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] RE: Having trouble with this package

Is the application 32 or 64 bit?

Packages run as 32-bit, you may need to call c:\windows\sysnative\regedit.exe 
to call the 64-bit version, otherwise it will place it in 
HKLM\Software\Wow6432Node.
Daniel Ratliff

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Enley, Carl
Sent: Tuesday, November 24, 2015 11:05 AM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] RE: Having trouble with this package

What hive is the .reg file writing to? Can you post the content of .reg file 
removing any personal information?

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Heaton, Joseph@Wildlife
Sent: Tuesday, November 24, 2015 10:54 AM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] Having trouble with this package

I have a simple program that I need to install, and I need to make a registry 
change along with it.  I chose to batch the process, and here's what I have:

msiexec /i "%~dp0\install.msi" /qn

regedit /s  "%~dp0\change.reg"


The registry setting is not happening.  Therefore, the application opens in 
trial mode.  I've also tried reversing the order of these commands, and that 
install doesn't seem to go anywhere.  I've looked at other packages that a 
coworker had done previously, and I'm not seeing any real differences.  If I 
open the ccmcache, and run the setup.bat as my administrator account, it works 
fine.  My SCCM service account is also a Domain Admin, so I'm not sure what the 
difference there would be, either.  Any help would be appreciated.

Joe Heaton
Information Technology Operations Branch
Data and Technology Division
CA Department of Fish and Wildlife
1700 9th Street, 3rd Floor
Sacramento, CA  95811
Desk:  (916) 323-1284

Every Californian should conserve water.  Find out how at:
[SaveOurWater_Logo]<http://saveourwater.com/>
SaveOurWater.com<http://saveourwater.com/> * 
Drought.CA.gov<http://drought.ca.gov/>




The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information 
in error,
please contact the sender and delete or destroy the material/information.


________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.





Reply via email to