How to delete a file in AlluserProfile directory?
-
Hi, I am newbie to vc++,So kindly bare with me. Some malicious exe file running in a folder c:\documentsandsetting\alluser\globel\phunk.exe I have killed the phunk.exe from the process and now i want to delete the file phunk.exe from the folder. how can i implement GetAllUsersProfileDirectory() APi to delete the file please can anyone put the same code for the above scenario.
-
Hi, I am newbie to vc++,So kindly bare with me. Some malicious exe file running in a folder c:\documentsandsetting\alluser\globel\phunk.exe I have killed the phunk.exe from the process and now i want to delete the file phunk.exe from the folder. how can i implement GetAllUsersProfileDirectory() APi to delete the file please can anyone put the same code for the above scenario.
Not an answer to your question, but when you say "kindly bare with me" it sounds like you're asking the reader to get naked with you. You need to use the spelling "bear" which means the big fuzzy ursine critters as well as carrying something. It's an easy mistake to make - quite a few Americans I know keep saying they support the right to bare arms, which is fairly non-controversial if you use sun-screen. Cheers, Ash
-
Not an answer to your question, but when you say "kindly bare with me" it sounds like you're asking the reader to get naked with you. You need to use the spelling "bear" which means the big fuzzy ursine critters as well as carrying something. It's an easy mistake to make - quite a few Americans I know keep saying they support the right to bare arms, which is fairly non-controversial if you use sun-screen. Cheers, Ash
-
Hi, I am newbie to vc++,So kindly bare with me. Some malicious exe file running in a folder c:\documentsandsetting\alluser\globel\phunk.exe I have killed the phunk.exe from the process and now i want to delete the file phunk.exe from the folder. how can i implement GetAllUsersProfileDirectory() APi to delete the file please can anyone put the same code for the above scenario.
Hi. Your question isn't quite clear. For one, why do you want to delete that file programatically, what you say suggests you simply want to delete a file, so locate it in windows explorer, right click it and select "Delete". You shouldn't have the need to write a program for that. For two, GetAllUsersProfileDirectory[^] simply gives you the path to the "All Users" folder, it doesn't delete anything, but i will assume you know that and you are simply asking how to use this function, something like this (not tested, error checking ommited):
DWORD charsNeeded;
GetAllUsersProfileDirectory(NULL, &charsNeeded);
TCHAR *FolderPath = new TCHAR[charsNeeded + 1];
GetAllUsersProfileDirectory(FolderPath, &charsNeeded);
... the path should be in the FolderPath buffer now, do whatever you want with it...
delete []FolderPath;> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <