Do shell script to rename a file - what's wrong with my syntax?

Would anyone know why this would not work ?

I must ensure I always include the Volume name in my solution. This is why I am typing MacIntosh HD in my syntax.

set abcd to "mv -i /Macintosh HD/Users/MyUserName/MPEGfiles/03/IDX00305.MPG /Macintosh HD/Users/MyUserName/MPEGfiles/03/IDX00306.MPG"
do shell script abcd

If I use

set abcd to "mv -i /MPEGfiles/03/IDX00305.MPG /MPEGfiles/03/IDX00306.MPG"
do shell script abcd

am I sure it always start at the root directory.

I will be executing the same command on an external drive named “GANDALF”, I will try to see if If I use

set abcd to "mv -i /GANDALF/MPEGfiles/03/IDX00305.MPG /GANDALF/MPEGfiles/03/IDX00306.MPG"
do shell script abcd

will work.

Thanks again!

Your posix paths have some flaws. Rather than tell you the problems it’s easier to show you how to figure it out. Just run this script and look at the result to see the path to use. Obviously if you need to find the path to a folder change the first line to “choose folder” instead.

set a to choose file
POSIX path of a


the root directory of the startup volume is always / , regardless of its name
the POSIX path of external volumes starts always with /Volumes

not always… a user can mount a volume to any directory it wants. For NFS it’s very common to mount a volume to a directory that’s visible in the Finder and also looks like a Folder