for some reason after i edit my cfg in notepad then change it back to .cfg, it stays a .txt icon. then when i load up hl2dm the game writes a new config.cfg.
i just formatted, the game never did this before.
Mine did that to me, too - when I was re-building my autoexec.cfg. (after a re-format, no less)
I don't have an answer, just a work-around. I copied the config.cfg created by the game, pasted my stuff in the new one and renamed it to autoexec.cfg and it was fine.
Presumably you can do the same - copy your config.cfg, edit it to what you want - delete the original one, rename the copy.
You shouldn't try to edit config.cfg. The game overwrites it sometimes. Did you try to change anything in the options menu? That can do it. It's not actually an error, but it's damned annoying.
Put all your keybinds, scripts, etc., in an autoexec.cfg file, instead.
But, as for your problem of writing it as a txt file.
Have you set the folder options to view file extensions? If not, then you need to do that. Then you can just edit the file name and change the extension.
What is actually happening, I think, is that windowsXP by default hides known file extensions. So in an explorer you have "config.txt", however XP hides the .txt so it is just "config". When you try and change it to a config file you rename it to "config.cfg" but it is actually "config.cfg.txt"
To stop this, go to any folder on your hard drive. In the File, Edit menu bar, select View>Folder Options>View and untick Hide Extensions for known file types.
I don't know why MS decided to make this a default, as it may stop confusion for filetypes for newbie users, however it makes it easy for them to be fooled by virus' named something like BRITNEYNEKKID.JPG.exe
EDIT: oh and you don't need to change the file to a .txt to edit it, just double click and select for it to be opened in wordpad or notepad, whatever.