Category : windows

I cannot figure out how to echo the date and time, with a zero padded hour, to insert a timestamp in my batch files. The following is the set command that I use to echo the date and time: set _DateTime=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%_%time:~0,2%-%time:~3,2% echo _DateTime=%_DateTime% The following is what the code above generated in the console window ..

Read more

#include <Shlobj.h> #include <iostream> #include <string> std::string fun(REFKNOWNFOLDERID val) { ITEMIDLIST* pIDList; if (S_OK == SHGetKnownFolderIDList (val, 0, NULL, & pIDList)) { char cpath[MAX_PATH] = {0}; if (TRUE == SHGetPathFromIDList(pIDList, cpath)) return cpath; } return "failed"; } int main() { std::cout << "–> " << fun(FOLDERID_ProgramFiles) << std::endl; std::cout << "–> " << fun(FOLDERID_ProgramFilesX86) << ..

Read more