Alternative to additemtodock from Henri Shustak
Open Applications / Utilities / AppleScript Editor and paste this:

my add_item_to_dock(choose file of type {"APPL"} with prompt "Choose an application to add to the Dock:")
on add_item_to_dock(item_path)
try
        get item_path as alias -- you need a POSIX path so this coerces the path in case it's an HFS path, alias, file ref, etc.
        set item_path to POSIX path of item_path
    end try
    try
        tell application "Dock" to quit
    end try
    do shell script "defaults write com.apple.dock persistent-apps -array-add '&lt;dict&gt;&lt;key&gt;tile-data&lt;/key&gt;&lt;dict&gt;&lt;key&gt;file-data&lt;/key&gt;&lt;dict&gt;&lt;key&gt;_CFURLString&lt;/key&gt;&lt;string&gt;" &amp; item_path &amp; "&lt;/string&gt;&lt;key&gt;_CFURLStringType&lt;/key&gt;&lt;integer&gt;0&lt;/integer&gt;&lt;/dict&gt;&lt;/dict&gt;&lt;/dict&gt;'"
    try
        tell application "Dock" to activate
    end try
end add_item_to_dock


Save it as Script or Application.