Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a random generated number that is a variable(randname.exe), I have exported a registry file ( hkey.......computername="???") how can I get a batch to insert the random variable into the reg file computername. I'm rolling out 50 computers a day and the image being used for the computer burnin is Win98 and I have duplicate names on boot that require a keystroke, I have this fully automated except for this problem.And I need the network connection to get the time from the server to update the BIOS time with a seperate program, unless there is a way to extract time off of the ghost image(sorry 2 questions)

Forgot to add using PXE to boot to ghost 7.5 and multicasting image on. Image is being used just for the burn in software( Using 98lite just to keep image size down). And setup of Automated BIOS Flashing and settings setup.

If you have exported the Registry key entry into say somefile.REG and it has the proper REG file header in it, then you could just add to you batch file:
EXPLORER somefile.REG
and it will add it. The problem is that this produces several prompts that require responses. There should be a few options that can avoid them, or you could use some other program to run the *.REG file.

Just how does the explorer command insert the variable into the reg file, I can use the regedit in does to import it back in that's not the problem , my problem is how do I insert a random variable into a text file.(code would be nice:))

a batch file can be made that would run under windows with the same prompts but the problem is that under DOS it wouldn't work. I'm I missing something or not?
borelli34

Could you just create a search(FIND) of the .reg file for the computername then insert the variable?? then you would just use regedit in DOS

Have a look at LISTMOD.ZIP at URL:
http://riverbbs.net/files/output/7702.HtmlLISTMOD.ZIP Size: 1829 Date: 1994-05-29
LISTMOD.COM transforms a given list, line by line, into a BAT file with the required commands.It will read an input TEXT file, and by various WORD-LEVEL manipulations, output a text (BAT) file with added boilerplate text, inserting any/all words from the original file.
You can alter the ordering of the input words on a line-by-line basis, and LISTMOD even has the ability to insert sequential number of any reasonable length into the output stream.
It takes a little bit to get used to the syntax used, but is well worth the effort. I've been using LISTMOD for 6 years, and regard it as a "must-have" for my toolkit.
Baldy.

@ECHO OFF
SET YOUR_VARIABLE=1ECHO Writing REG header . . .
> YOUR_REG.REG ECHO Windows Registry Editor Version 5.00
>>YOUR_REG.REG ECHO.
>>YOUR_REG.REG ECHO [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
>>YOUR_REG.REG ECHO "Synchronization Manager"="%YOUR_VARIABLE%"
ECHO Closing REG fileSET FILE=
SET NAME=
SET EXT=
ENDLOCAL
:END

![]() |
HD not found, help!
|
A beginner question
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |