Since backslash is considered as a special character(escape), it's causing the issue. Use /
or \\
in the path as:
c:/foldername/subfoldername
c:\\foldername\\subfoldername
OR as you said, use @
in the front as :
@"c:\foldername\subfoldername"
EDIT: For Javascript, I will simply replace the \
to /
as below:
path = path.split("\\").join("/");