By far the easiest way to create the Distributor is via the Wizard and examples abound of that – one such example is at SQL Server Central http://www.sqlservercentral.com/articles/Stairway+Series/72282/ . So why use scripts? Mainly for Disaster Recovery and consistency. Should you have to rebuild the server then running the scripts is easier and more reliable …