Wednesday, September 21, 2011

How to make a batch file to change a win XP registry value?

hey people, i wanted to know how we can edit the windows XP registry through command prompt and can a batch file be created for the same?How to make a batch file to change a win XP registry value?
Yes, and you don't actually have to create a .reg file to edit the registry as cmd has a command especially for that. The command is 'reg', type 'reg /?' for more info on it.



Examples:



reg add HKLM\Software\Microsoft\Windows\CurrentV?/v EXAMPLE /t REG_SZ /d ';C:\Program Files\examplefolder\examplefile.bat';



This command would add a string value to the registry path 'HKLM\Software\Microsoft\Windows\Current?(which, by the way, is the registry folder which runs stuff at startup), the value would be named 'EXAMPLE' and it's value would be ';C:\Program Files\examplefolder\examplefile.bat';. This means that after executing this command, a file called examplefile.bat would start every time I boot up my computer.



This can be used to change, add, delete, and do a plethora of other things to do registry. A word of warning though, changing anything in the registry could have dire consequences, use with caution :PHow to make a batch file to change a win XP registry value?
Yes, it can be done. Your batch file should:



1) Create a '.reg' file containing instructions to regedit to tell it what to do.



2) Run regedit on the '.reg' file.



3) Remove the '.reg' file.



See the link below which explains the theory and provides a few examples.
  • excel
  • for couples and singles
  • No comments:

    Post a Comment