[?]REG SAVE

A

anonymous

Could Use some help for one reason or another the Value under the key is not
being saved. Is it not possible to save indiviual values within keys?

Command Used:
REG SAVE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyServer" "C:\PROXYSERVER.REG"
 
D

David Wang [Msft]

You have to save the entire key to the .REG file.

If you knew the exact properties that you wanted, you should be able to CALL
REG.EXE to query and set those specific properties and do not need to SAVE
anything.

If you want to do save a particular property value and restore it on
machines without REG.EXE, you should create your own .REG file using RegEdit
(Export the node you're interested in), edit out the properties you don't
care about, and use RegEdit to do the import.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
Could Use some help for one reason or another the Value under the key is not
being saved. Is it not possible to save indiviual values within keys?

Command Used:
REG SAVE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyServer" "C:\PROXYSERVER.REG"
 
A

anonymous

David - thats all correct but I want to save the specific key and value
which I mentioned in my first post what U have suggested wont help in this
effert but thx anyhow.
 
M

Mark V

In said:
David - thats all correct but I want to save the specific key and
value which I mentioned in my first post what U have suggested
wont help in this effert but thx anyhow.

reg.exe SAVE saves a key-subkeys-values in a binary file. No "single
valuenames and data".

You can do the Export to text file with regedit.exe, then edit the
file. Manually or via scripting.

You can use reg.exe (2.0) to do a QUERY operation and redirect the
output to a file.

Perhaps if you say the actual task, better suggestions will be
forthcoming.
 
D

David Wang [Msft]

REG isn't going to save/restore individual property values (makes no sense,
anyway). Tools are to be used as designed, not however you want -- the
principle doesn't change between real hardware tools and software tools.

I suggested that you:
1. use RegEdit to save/restore individual registry property values. This is
a text file that is portable to machines without REG.EXE
2. use REG to directly query/set the individual registry property values.
This works for machines with REG.EXE

I use both methods to set individual registry keys all the time, depending
on whether the target system has REG.EXE (Windows 2000 does not have REG.EXE
by default).

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//

David - thats all correct but I want to save the specific key and value
which I mentioned in my first post what U have suggested wont help in this
effert but thx anyhow.
 
M

Matthias Tacke

anonymous said:
David - thats all correct but I want to save the specific key and value
which I mentioned in my first post what U have suggested wont help in this
effert but thx anyhow.
Guessing you want to create a file "Proxserver.reg" and inport that to
several workstations with changing *only* the Proxyserver.
Since Reg.exe is already present I'd use the export function of reg.exe
(I'm using V2.0 in w2k)
Since the file will contain every value and subkey you have to filter
on that with a batch like this:

::Make-Reg.cmd:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
setlocal
set Key=HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings
SET KEY=%KEY:HKCU=HKEY_CURRENT_USER%
Set Val=ProxyServer
set File=C:\ProxyServer.reg
Set "Vline="
for /F "tokens=1,2,* skip=6" %%A in ('REG Query "%Key%" /v %Val%') do (
If /I "%%A" EQU "%Val%" set Vline="%%A"="%%C")
If Not defined Vline echo ==Key or Value not found==&goto :eof
%File% echo/Windows Registry Editor Version 5.00
%File% echo/
%File% echo/[%Key%]
%File% echo/%Vline%
::Make-Reg.cmd:::::::::::::::::::::::::::::::::::::::::::::::::::::::::

As is it works only with reg_sz value's.

HTH
 
M

Matthias Tacke

anonymous said:
Matthias - thx, exactly what I was trying to do.
Nevermind, happy I could help.
After rereading I realized that I changed the batch after having written
the posting. Since the export required discarding to many other lines I
changed to creating a reg file from scratch with the data obtained
through a reg query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top