Jump to content

How to automate .reg entries in RIS installations

Recommended Posts

I have RIS on a 2k3 server. RIS works great for what I need except for one thing and its getting the best of me. I need to have RIS automatically copy the i386 files to the c:\ drive. That part I was able to figure out. What I need to do now is change the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath to c:\ instead of it pointing to the RIS server. So I made a .reg file and called it sourcepath.reg.

Windows Registry Editor Version 5.00



I put sourcepath.reg in the $oem$ folder and made a file called cmdlines.txt in the $oem$ folder. Here is the cmdlines.txt file.


"regedit /s sourcepath.reg"

What am I doing wrong? I've been working on this for two days. I found most of my RIS help just by reading these forums. The post I found on my current issue at hand is here


I have read many other posts and tried other suggestions. This method seems like the easiest and most logical solution. I do not need anything fancy. Can anyone tell me what I'm doing wrong?

Thanks Guys!

Link to comment
Share on other sites

i just exported that key and noticer that the sourcepath looks like this:

Windows Registry Editor Version 5.00


notice i have the \\ missing.

So i would suggest checking find the key, export and delete what you don't want from it.

It won't import and incorrect key

Link to comment
Share on other sites

Nope, it still does not work. I exported the file again and this is what I see. Note the double slashes. BTW, This image is of win2ksp4.

Windows Registry Editor Version 5.00



Link to comment
Share on other sites

Ok, it still is not working. I'm going to post all the files I use for this process and their paths:


floppyless = "1"
msdosinitiated = "1"
OriTyp = "4"
LocalSourceOnCD = 1

OsLoadOptions = "/noguiboot /fastdetect"
SetupSourceDevice = "\Device\LanmanRedirector\%SERVERNAME%\RemInst\%INSTALLPATH%"

OemPreinstall = Yes
NoWaitAfterTextMode = 0
FileSystem = LeaveAlone
ExtendOEMPartition = 0
ConfirmHardware = no
NtUpgrade = no
Win31Upgrade = no
TargetPath = \WINNT
OverwriteOemFilesOnUpgrade = no
OemSkipEula = yes

FullName = "aaa"
OrgName = "aaa"
ComputerName = *
ProductID = "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"

OemSkipWelcome = 1
OemSkipRegional = 1
TimeZone = 35
AdminPassword = "*************"

AutoMode = PerSeat

ConfigureAtLogon = 0
BitsPerPel = 32
XResolution = 1024
YResolution = 768
VRefresh = 60
AutoConfirm = 1


Command1 = "\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\$1\w2k-isg-addon\install.bat"

JoinWorkgroup = workgroup


; transport: TC (TCP/IP Protocol)




; service: SRV (Server)
BroadcastsToLanman2Clients = No


Repartition = Yes
UseWholeDisk = Yes

Description ="Microsoft Windows 2000 Professional SP4"
Help ="Automatically installs Microsoft Windows 2000 Professional without prompting the user for input."
LaunchFile = "%INSTALLPATH%\%MACHINETYPE%\templates\startrom.com"
ImageType =Flat
Version="5.0 (2195)"


"regedit /s sourcepath.reg"


Windows Registry Editor Version 5.00


Now, I know the sourcepath.reg file works because I merged it with the system I just ris'd and it changed the sourcepath to c:\. So the \\ seems to be correct. Anyone know what else I'm overlooking? I have a feeling it is sitting right under my nose, I'm just not seeing it.

Edited by infoteklink
Link to comment
Share on other sites

cmdlines is too early to make that registry change. You should try doing it from GuiRunOnce or RunOnceEx. It's not that you can't import reg entries during the cmdlines execution, I do it on every install, it's what you're changing. There are numerous registry entries that will not "stick" when made from cmdlines and I think this may be one of them.

Link to comment
Share on other sites

@RogueSpear: How do you import registry settings from your cmdlines.txt? I'm using it for my riprep image. Everytime I try to import settings into the registry it gives me an error that it can't access the registry. In my riprep-image I have the folder SYSPREP\i386\$oem$

In that directory I hace cmdlines.txt with under the [commands] section "regedit import.reg"

Also in that directory there is the import.reg file

I don't use the /s yet because I keep getting the access error of the registry.

Edited by Arbeider
Link to comment
Share on other sites

This is my cmdlines.txt:

"cscript cmdlines.vbs"

There's a line in the VBscript that imports:

ws.Run("REGEDIT /S cmdlines.reg"),0,True

I see you're using RIPrep however. I can't understand with thread after thread of the same problems why people still insist on using that. Anyway, I can't say for sure what works or not under RIPrep. The above may work, it may not.

Link to comment
Share on other sites

I'm still having a small problem. First I'll post all my processes then give a pic of what I still can not accomplish.

My .sif

Command1 = "\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\$1\w2k-isg-addon\install.bat"

Install.bat to copy i386 files to local c drive and start the .reg process (.reg process is still the problem)

xcopy "\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\$1\w2k-isg-addon\i386\*.*" "c:\i386\*.*" /s /y

call "\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\reg_add.bat"


start regedit /s


Windows Registry Editor Version 5.00


Everything seems to work good except I still have to click to accept the setting for the reg entry.



and here


How can I automate that?

Edited by infoteklink
Link to comment
Share on other sites

try removing the word start from your reg_add.bat - for some reason this can be weird in action - i had similar issue other day and noticed it all worked with no start action. also is it all one long line as codebox may be breaking it ni display - just wanted to check

Link to comment
Share on other sites

HAH!! You guys are the doo doo! :thumbup I did have the lines seperate. I put them on the same line and now it works perfect. Here is my reg_add.bat file now.

regedit /s \\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\sourcepath.reg

I initially left the "start" in to see if it mattered or not. It didn't matter if it was there or not, so I just took it out. No need to have more crap in the code than needs to be.

Thanks again RogueSpear and oioldman!!

Link to comment
Share on other sites

  • 4 weeks later...

I've also found that you have to change the sourcepath in two locations, always worth considering:




HKLM\Software\Microsoft\Windows NT\CurrentVersion


For some reason I've found only changing one of these values doesn't work. Changing both always works, praps I've just run across a glitch unique to me.

Cheers and beers


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