That's an annoying problem that happens sometimes.
I seriously suggest you do not do this, but this is the only way to fix it without reinstalling it:
1. Press Win+R, or go to Start>Run, type in regedit, and go to HKEY_LOCAL_MACHINE>Software>Electronic Arts and look for the Battlefield 2142 folder, if it's not there, check for it in a folder called EA Games or Electronic Arts in the Electronic Arts folder.
If it's not there, the install never added a registry entry, so you'll need to reinstall it. If it is:
Since I don't have Battlefield 2142, I don't know the proper field, but it should be key called "InstallLoc", "InstallDir", or "DataDir", double click on it and verify that it is set to where Battlefield 2142 is installed, if it's not, then change it to the proper directory.
Again, I suggest you don't do this, as messing with the registry editor can severely screw up your computer.