DIGIT-ARC read-only archive · snapshot: July 23, 2026

batch file to add registry key

8 posts · originally from https://geek.digit.in/community/threads/batch-file-to-add-registry-key.150757/

A
abhayalmighty Original post #1
Jan 1, 2012 at 6:21 PM
i want to create a batch file which will add its directory path to registry as a string value.
A
Jan 1, 2012 at 7:07 PM
just google it!!
Vyom
Vyom #3
Jan 1, 2012 at 9:04 PM
Yeah... google it.. and if you are too lazy, here is what would I have done..

1. Create a reg file(s) for the key containing the string
2. Create a batch file which would call those reg files, in separate lines
3. Just run the batch file...
A
Jan 2, 2012 at 2:36 PM
how to i get batch file's directory path. And ho to put it in reg file
Vyom
Vyom #5
Jan 2, 2012 at 8:02 PM
See the following guides:
How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file
Batch files - Use REGEDIT to add, read or delete registry values

To know path of any file, just right click on it, and select properties.
A
Jan 3, 2012 at 11:44 AM
got it. thnx for replying.
close this post mods
Vyom
Vyom #7
Jan 3, 2012 at 1:46 PM
Doesn't work like that. You will have to post how exactly did you preform your task, and then this thread can be closed. ;)
A
Jan 3, 2012 at 7:09 PM
Yeah... google it.. and if you are too lazy, here is what would I have done..

1. Create a reg file(s) for the key containing the string
2. Create a batch file which would call those reg files, in separate lines
3. Just run the batch file...

that's how i got it to work now plz close this post