Code: Select all
$sourcefile = "E:\DroneRawFiles\output.kmz"
$file = "40C7BC61-616C-4B5E-9840-0DD500E20E40";
$folder = "DJI RC 2\Internal shared storage\Android\data\dji.go.v5\files\waypoint\" ;
// this works
$fullpath = $folder . "40C7BC61-616C-4B5E-9840-0DD500E20E40" . "\";
goto $fullpath;
// this fails
// $fullpath = $folder . "\" . $file . "\";
// goto $fullpath; // error: path not found
// echo $fullpath; // the output includes the literal "$file" instead of the current value
// this fails
delete $fullpath . "40C7BC61-616C-4B5E-9840-0DD500E20E40.kmz"; // error: Nothing to delete
echo $fullpath . "40C7BC61-616C-4B5E-9840-0DD500E20E40.kmz"; // it looks correct in the message
How do I create the $fullpath variable by concatenating its component parts? Any help appreciated.