I know how to backup a registry key from within regedit.exe but would like to know how I can go about creating a text file with the registry keys for my app and then saving that as backup.reg. (getting those keys from the registry)

Please advise if this can be done and if so, how would I go about doing this? Have searched VBF and found nothing that answers this question. Thanks in advance for any suggestions.