You can script the replication through Enterprise Manager and also can be done using SQL DMO.
Script the replication when you are running on different server you need to replace the servername.
Enterprise manager/Server name/tools/replication/Generate sql scripts...
MohammedU
Microsoft SQL Server MVP