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...
CopyFile() on windows
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: CopyFile() on windows
Why not use GetTempFileName()?
Re: CopyFile() on windows
What did you say? GetTempFileName()?
Ohh man, that problem was stolen several hours from my life.
But how on earth should I remember all of the functions, the guide is now at 2 and a half megabytes long?
Ohh man, that problem was stolen several hours from my life.
But how on earth should I remember all of the functions, the guide is now at 2 and a half megabytes long?
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: CopyFile() on windows
It's a very old function actually... has been present since v3.0. That's like 8 years or so