node-copy-paste icon indicating copy to clipboard operation
node-copy-paste copied to clipboard

Windows: wrap __dirname path in quotes to account for spaces

Open tupini07 opened this issue 9 years ago • 0 comments

In Windows if __dirname points to a folder which is inside any folder with a space in it's name then when trying to execute the 'paste' fallback it would fail and throw the following error:

Error: Command failed: cscript /Nologo C:\Users\User Directory\node-copy-paste\platform\fallbacks\paste.vbs Notice here that User Directory has a space in it's name.

When the whole node-copy-paste folder is in a path with no spaces (for example C:\) running 'paste' doesn't throw any errors. Wrapping the whole path in quotes makes the command work correctly.

I'm using Node 6.2.2 on Windows 10 and this fix works, I'm not sure if this problem was also present in other versions of Windows.

tupini07 avatar Jul 13 '16 23:07 tupini07