?
Solved

Reg add - contetnt of a txt file

Posted on 2011-10-17
6
Medium Priority
?
428 Views
Last Modified: 2012-08-13
Hi

I would like to add a reg value with a bat file, but I would like to add the content of the txt file (not the filename...). How can this be done?

reg add "HKLM\SOFTWARE\product\123\settings" /v "Text value" /d "c:\test.txt" /f

This gives me c:\test.txt in the registry, and that is not what I want.
0
Comment
Question by:ako74
6 Comments
 
LVL 11

Expert Comment

by:X_layer
ID: 36982258
And what do you have in this txt file?
0
 

Author Comment

by:ako74
ID: 36982278
I run a script on this PC collecting some information about user and local PC. So it is a combination of data in the txt file.
0
 
LVL 11

Assisted Solution

by:X_layer
X_layer earned 664 total points
ID: 36982286
As far as I know, this is not possible. But you can add user information in registry with same script that you are using for collecting data.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 13

Accepted Solution

by:
Govvy earned 668 total points
ID: 36982290
0
 
LVL 81

Assisted Solution

by:arnold
arnold earned 668 total points
ID: 36982294
What do you want to add?
Are you looking to add the contents of the c:\test.txt file as the data?
/d is the data that will be set.
You likely need to use VBscript to get the data out of the file and then create the entries and you may as well use the vbscript API tie in into the registry,

http://www.tek-tips.com/viewthread.cfm?qid=1484217&page=4
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 36982816
It is quite possible to get the data out of a text file and then use it in a reg.exe command.... but then this has already been marked as answered?!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question