I have C:\\Temp\\MyFolder\\mytextfile.txt in a variable called $file
C:\\Temp\\MyFolder\\mytextfile.txt
$file
I want C:\\Temp\\MyFolder\\ in another variable.
C:\\Temp\\MyFolder\\