I just discovered that, when SHIFT is run (the first time), the value of %~dp0 changes from the script's parent dir to the current working dir