Assuming we are talking replication. Do this.
/* ************ */
/*RUN ON DISTRIBUTOR*/
USE master
GO
EXEC sp_adddistributor @distributor = 'distributorname' , @password='pa$$word';
GO
EXEC sp_adddistributiondb @database = N'distribution', @security_mode = 1;
GO
/* Make sure the UNC is prepared */
USE distribution
EXEC sp_adddistpublisher @publisher=N'publishername', @distribution_db=N'distribution', @security_mode = 1, @working_directory='\\distributorname\repl'
GO
and this
/*RUN ON PUBLISHER*/
USE master
EXEC sp_adddistributor @distributor = 'distributorname', @password='pa$$word';
GO