Thanks for the replies guys!
I may have included too many details...either that or I misunderstood
the first reply (cause it looks like you stated the same thing I
did?), or he understood it better than I did, and that is exactly what
I asked for...
All I need is a simple script (say, a .reg file that could be merged,
or a script that could be executed with reg.exe) that does this:
1) asks what is the current name of this machine right now?
2) take answer to #1 and inserts it to a pre-defined key as the new
you know, something simple like:
*get current name of machine, place that name below*
"test"=*name of machine/answer to above statement*
or just a simple command that you could place after "test"= that says
"get current name of this machine, place that name here"
that's all I need to do.
Again, thanks in advance for the help.
> Mark's suggestion looks good.
> I wrote a program to do this a while back. You can download it from
> Regvars.exe is a utility for scanning registry files (.reg) and replacing
> any instances of environment variables with their expanded versions. For
> example, if you run a reg file containing %programfiles% through the
> program, it will replace all instances of %programfiles% with, for example,
> "c:\program files".
> Regvars.exe also has an added "virtual" environment variable called %cd%,
> which evaluates to the first CD-ROM drive in the system
> The syntax is "regvars.exe input.reg output.reg". There is no error checking
> for the command line parameters and it's pretty rough and ready, but does
> the job.
> NB. Regvars.exe current doesn't accept unicode files. The default for a .reg
> file is unicode. To overcome this, when saving the input file from regedit,
> be sure to select the "95/NT regedit4" option from the save dialogue box.
> You would include the %computername% in your source registry file and run
> the regvars.exe program on the destination machine to create a new reg file
> with the environment variables expanded. You can then use "regedit /s" on
> the new file to import the registry entries.
> Hope this helps
> > I need to do the following in either reg.exe or a .reg file...
> > (This is for an autologon to local machine without an NT domain,
> > manual logon to Novell BTW.)
> > I need to use the %computername% environmental variable to make a
> > change to a couple of values in the registry like so:
> > HKLM\SOFTWARE\Microsoft\Windows
> > NT\CurrentVersion\WinLogon\DefaultDomainName = (get the current value
> > for %computername% and use that value here)
> > I would have preferred to do this with a reg_expand_sz entry in the
> > first place, but it seems the novell client will not take the
> > variable. So as it stands now (as a reg_sz entry,)when I distribute my
> > ghost to my lab machines, renaming the box breaks the autologon...I
> > guess enabling autologon makes the DefaultDomainName stay the same
> > even when you change the machine name by normal methods.
> > here is what I have tried, I am sure it is way off though (cause it
> > didn't work)
> > REGEDIT4
> > [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon]
> > "test"=echo %computername%
> > I get nothing by merging the above (or any other combination of "("
> > "<" or "[" I have tried). I know the basic script works, because I can
> > do a "test"="testdata" and show up in the right place correctly
> > displaying the value testdata. I have tried many different variations
> > using echo and set, but I am not a code-writer and cannot find
> > examples of doing anything like this anywhere else.
> > anyone out there know how to do this by any chance?
> > thanks in advance for any help.