The best way to work with paths - use path
module (API):
Or with path
module:
var path = require('path');
path.join('E:','Thevan','Some File.mp4');
It also fix more issues if you switch to Linux.
But you have an other problem - you pass DIRNAME
instead of FILENAME
to writeFile
function. I think you mean:
var newPath = "E:\\Thevan\\something.mp4";
var oldPath = "E:\\Thevan\\Docs\\something.mp4";