For your specific issue, one R based solution I'm aware of is to use the utils function readClipboard()
For example, if you copy "C:\Program Files\R" from the address bar of windows explorer

Then in the console do:
fp <- readClipboard()
fp
#> [1] "C:\\Program Files\\R"
You'll see
"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 /
does)
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...