How to Create a CFG File

Level of difficulty: Difficult

Experienced programmers may choose to edit or create CFG files to make a particular software function in a certain way. A .cfg file is a configuration file used to create particular settings in software. These are command lines, usually edited using a text editor such as notepad. Normally, these kinds of files should not be tampered with as it has a possibility of corrupting the whole file. One very popular use of the CFG or .cfg file is in computer gaming. Config files start up a particular game according to the preference of the user.

Materials Needed:
- computer
Step 1
Let us try making an autoexec.cfg file for the very popular game Counterstrike. You can type in any console command of your choice, such as variables pertaining to game settings. When the game is started, it will begin by reading the autoexec.cfg file and the instructions in it.
Step 2
Open a text editor like notepad or wordpad and make a new document.
Step 3
Type in the scripting code you want to put in the file like for game changes, aliases, etc.
Step 4
When the texts in the configs come after two slashes, the game understands these as comments and will not consider them as instructions for functioning. This is particularly useful for the novice programmer in giving hints as to what the script is about. A script giving a set of instructions then follows it. The other texts beginning with a double slash are commentaries or additional instructions. These are intended for the user and not for the computer.
Step 5
Save the file using this particular label (case sensitive): 'autoexec.cfg' and place the file in the cstrike\cfg directory.
Step 6
Save this in the cstrike\cfg directory.
Step 7
Now go to config.cfg and add this particular line to the script: exec autoexec.cfg.
Step 8
There are a multitude of script additions and suggestions found online to be able to edit a particular game. Now that you know how to create and edit a .cfg file, you will be able to tweak your game to suit your particular needs.
Step 9
There are also CFG files available for download or distributed by other users. These CFG files were designed by other users for a particular application. Keep in mind to scan the CFG files before using them since there is a possibility of the CFG files being bundled with malicious programs such as spyware components, viruses, worms, trojans, etc. Even if the CFG files came from a trusted source such as CFG files sent as email attachments by your friends and colleagues, always make it a point to initially scan the files with legitimate anti-malware applications since there are malware variants designed to infect email or Web servers and embedded with mass mailing capabilities or automatic website distribution protocols.