Well, the code is pretty much complete now;
Code:
#include <windows.h>
#include <tchar.h>
#include <iostream>
#ifdef UNICODE
#define tcout wcout
#else
#define tcout cout
#endif
int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE hprevious, LPSTR cmdline, int cmdshow) {
STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
TCHAR lpCmdLine[MAX_PATH] = {0};
::ExpandEnvironmentStrings(_T("\"%ProgramFiles%\\Symantec\\LiveUpdate\\LUALL.exe\""),
lpCmdLine, MAX_PATH);
std::tcout << _T("Command line : ") << lpCmdLine << std::endl;
BOOL bRet = ::CreateProcess(NULL, lpCmdLine, NULL, NULL, FALSE,
CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
ShellExecute(NULL, TEXT("open"), TEXT("explorer"), TEXT("\\Panarchy\\share"), NULL, SW_HIDE);
ShellExecute(NULL, TEXT("open"), TEXT("control"), TEXT("schedtasks\0"), NULL, SW_HIDE);
ShellExecute(NULL, TEXT("open"), TEXT("control"), TEXT("sysdm.cpl"), NULL, SW_HIDE);
ShellExecute(NULL, TEXT("open"), TEXT("diskmgmt.msc"), NULL, NULL, SW_HIDE);
{
if( reinterpret_cast<int>(ShellExecute(NULL, "explore", "\\\\panarchy\\share", NULL, NULL, SW_SHOWNORMAL)) <= 32)
if( reinterpret_cast<int>(ShellExecute(NULL, "explore", "D:\\BackYouUp\\", NULL, NULL, SW_SHOWNORMAL)) <= 32)
{
ShellExecute(NULL, "explore", "C:\\Backups\\bac\\", NULL, NULL, SW_SHOWNORMAL);
}
}
return 0;
}
The only caveat is that it takes a while for the program to process the
ifs. If anyone knows a way around that, I'd appreciate it. If not, then the program is complete.
Panarchy