CopyFile() on windows
Posted: Mon Mar 14, 2016 1:00 pm
It is really hard to live on the wintel world 
I want to copy a file to the temporary drawer (folder) because of other command line weirdness.
The CopyFile() has a destination drawer argumentum, but it do not handle %temp% style insanity.
The temp drawer is in the registry under HKCU/Environment/Temp, but contains %userprofile%. Recursive insanity.
(
To workaround I am trying to use the default temp path %USERPROFILE%\AppData\Local\Temp. (What if it is not there on some config?)
GetSystemInfo() can give me the user's AppData path, but it is not the same as %USERPROFILE%\Appdata.
So, CopyFile("source.txt",GetSystemInfo().appdata.."\\..\\Local\Temp") works with the default settings.
Anyone heard about the invention of 'T:' ? Bah...
I want to copy a file to the temporary drawer (folder) because of other command line weirdness.
The CopyFile() has a destination drawer argumentum, but it do not handle %temp% style insanity.
The temp drawer is in the registry under HKCU/Environment/Temp, but contains %userprofile%. Recursive insanity.
To workaround I am trying to use the default temp path %USERPROFILE%\AppData\Local\Temp. (What if it is not there on some config?)
GetSystemInfo() can give me the user's AppData path, but it is not the same as %USERPROFILE%\Appdata.
So, CopyFile("source.txt",GetSystemInfo().appdata.."\\..\\Local\Temp") works with the default settings.
Anyone heard about the invention of 'T:' ? Bah...