• Well, re-reading the script it tries to get the path of the executing batch file using this line:

    set ScriptPath="%~dp0"

    %0 is the full path of the currently executing batch file, and using %~dp0 should get the drive and path of that file. Then the lines that are stopping you are run:

    if not exist %ScriptPath%MoveSql2005SysDbs.sql (

    echo This command MUST be run from the SQL Server and the script file MoveSql2005SysDbs.sql

    echo must be in the same directory as the MoveSql2005SysDbs.cmd file.

    exit 1

    )

    So you might print out the ScriptPath variable using

    echo ScriptPath=%ScriptPath%

    before the lines that are stopping you to see if you can determine what went wrong.