For your specific issue, one R based solution I'm aware of is to use the utils function
For example, if you copy "C:\Program Files\R" from the address bar of windows explorer
Then in the console do:
fp <- readClipboard()
#>  "C:\\Program Files\\R"
"C:\Program Files\R" has automagically been converted to
"C:\\Program Files\\R" (which also works in the same way as using a forward slash
In more general terms there's also the base function
file.path() and also the
here package if you'd like to construct file paths in a more platform independent way...
Hope this helps...