I recently got email from friend who had suffered from following error.
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file “filepath” failed with the operating system error 2(The system cannot find the file specified.).
Msg 1802, Level 16, State 1, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file “filepath” failed with the operating system error 2(The system cannot find the file specified.).
Msg 1802, Level 16, State 1, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
As per him he had gone crazy to find solution. He had been trying to create database and he had all the admin privileges. After getting remote desktop, I realize that he was everything correct but the filepath he was trying to create. Once he corrected the filepath everything was smooth from there.
If you have the same error I suggest you carefully check your filepath. There must be some typo or error in filepath. If that is not the case and with admin rights you are still facing issue, post a comment here.
Reference: Pinal Dave (https://blog.sqlauthority.com)