Can you use a mod to uninstall your mods?
The answer is no. This post is for informational purposes only. Do not attempt unless you are an experienced Windows user and fully understand file structures and file operations. In either case backup your game. Following is for Steam Version of GTA5.
You can't uninstall all your mods using a mod. Unless uninstalling all your mods means deleting everything in sight. All the "Uninstall Mods" can do is delete entire folders, not files in encrypted archives such as Update.rpf. The root folder is the only folder which might cause you some confusion, so read on if you want to learn what you can or can't delete - safe in the knowledge that you can backup any files you're uncertain of or do a verify integrity or worst case a Reinstall.
The Go Medieval Method
This is very simple. Just delete your entire GTA 5 game folder. Everything will be gone except your settings and save games. Then reinstall.
The Selective Destruction
Delete your Mods folder and your Scripts Folder. Next delete everything in your root folder you don't recognize. See the next section for tips. Remember a verify integrity will correct any mistaken deletions.
Rooting out the Evil
Backup your game and then from your game folder, make sure extensions are visible, change the view to details, and sort by file type.
Step 1. You can delete your mods folder and your scripts folder and any subfolders other than the 3 in the screenshot below. For example you can delete the folder called menyooStuff. Backup if you're unsure. Do not delete any files in the X64, Installer, and Update game folders (in your root folder).
Step 2. You can now delete all asi mods as there are none in the vanilla game.
Step 3. You can delete all log files as well. You can keep the one called debug.log. Log files will be recreated so don't worry about removing any.
Step 4. You can delete all ini files but keep the one called hashes.ini
Now we need more caution, but again your can restore any mistakes with a verify integrity or that backup i advised you to do, just for those files you aren't sure about.
Step 5. You can delete all exe files, if any mod ones, except the 4 GTA 5 ones shown in the screenshot above. Yep, don't delete those with the green V and if you do by mistake V will remind you to Verify Integrity to restore them.
Step 6. You can delete all .dll except the ones shown in the screenshot at the bottom of this post. Be careful with this one as the game has its own dlls.
IF UNCERTAIN ABOUT DLL FILES, DON'T GO ANY FURTHER.
These are the Steam version game dlls with an Nvidia Card:
DO NOT DELETE bink2w64.dll d3dcompiler_46.dll d3dcsx_46.dll GFSDK_ShadowLib.win64.dll GFSDK_TXAA.win64.dll GFSDK_TXAA_AlphaResolve.win64.dll GPUPerfAPIDX11-x64.dll NvPmApi.Core.win64.dll steam_api64.dll
Those that are easily recognized and can be uninstalled include:
dinput8.dll ScriptHookV.dll ScriptHookVDotNet2.dll ScriptHookVDotNet2.xml ScriptHookVDotNet3.dll
That basically does it. Keep in mind that deleting dinput8.dll alone will keep all mods from loading so effectively giving you back a non-modded game.
You might notice other files such as menyooLog.txt which are safe to delete. Again refer to the screenshot below.
When you're finished, it will be a good idea to do a verify integrity just to ensure you didn't delete anything by mistake. Also, some poorly designed mods may have replaced files in your game folder, files that need to be restored. Finally, emulators will replace steam_api64.dll if your game is on Steam.
What NOT to delete.
Do not delete any file with an rpf extension in root folder. For example all those files like x64a.rpf all the way, and including, x64w.rpf. Keep common.rpf too.
Do not delete the file installscript.vdf. Do not delete any files in the X64, Installer, and Update game folders (in your root folder).
What about OIV installed stuff?
If you want to selectively uninstall just an OIV's mess you need to peek inside, with 7-zip and look inside a file called assembly.xml. If your new to modding or computing in general you should stop right here. If you're confident and curious you will see exactly what was installed by the OIV and where it was installed. If the OIV added new files that don't exist in the vanilla game, you can simply navigate to the path in OpenIV and delete them. If the OIV replaced or deleted files, then you will need to restore them from the original game files. Yep, real PITA and real good reason to install manually.