# batch file to add registry key



## abhayalmighty (Jan 1, 2012)

i want to create a batch file which will add its directory path to registry as a string value.


----------



## abhijangda (Jan 1, 2012)

just google it!!


----------



## Vyom (Jan 1, 2012)

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...


----------



## abhayalmighty (Jan 2, 2012)

how to i get batch file's directory path. And ho to put it in reg file


----------



## Vyom (Jan 2, 2012)

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.


----------



## abhayalmighty (Jan 3, 2012)

got it. thnx for replying.
close this post mods


----------



## Vyom (Jan 3, 2012)

Doesn't work like that. You will have to post how exactly did you preform your task, and then this thread can be closed.


----------



## abhayalmighty (Jan 3, 2012)

Vyom said:


> 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


----------

