i want to download a exe file with a url in c++, when the download path is with user Colin, its working, but when i do in the download path %username% then its not working. example: C:\Users\Colin\Desktop\hi\lol.mp3 = working C:\Users\%username%\Desktop\hi\lol.mp3 = dont working
MY CODE:
// the URL to download from
const wchar_t* srcURL = L"https://cdn.discordapp.com/attachments/815696193354203157/819662370224865320/lol.mp3";
// the destination file
const wchar_t* destFile = L"C:\\Users\\Colin\\Desktop\\hi\\lol.mp3"; //Path where file should be saved.(Works only with Colin but i want %username%)
// URLDownloadToFile returns S_OK on success
if (S_OK == URLDownloadToFile(NULL, srcURL, destFile, 0, NULL))
{
system("start C:\\Users\\%username%\\Desktop\\hi\\lol.mp3"); //Path of the file where you want to open //works with both [%username and Colin%]
}