when trying to output the string of a variable to a text file, the string try's to run and therefore pops up like this,
'C:\' is not recognized as an internal or external command,
operable program or batch file.
Why not try:
C:/> echo %localDrive% 2>fileCompare.log
echo in batch is good for writing to files.
Sorry, I realized that does not work at times....
Try executing: echo %localDrive%>fileCompare.log and it should work perfectly