DBAs and Developers at times may need to detach and attach the databases for various reasons including the following:

1. Moving files to other drives
2. Server migration
2. Upgrades,
3. system maintenance, etc.

This script takes away the headache of remembering the filename or folder location of every single data or log file for every single user databases on your server. It allows you to generate script to detach and attach one or all databases avoiding the need to remember the long hard-coded file path after detaching the database.