How to Delete Application
-
It is available in codeguru.com, just find it out.
Suggestion to the members: prefix your main thread subject with [SOLVED] if it is solved. chandu.
Hey Thnx, Got the link. Coming back to you after Checking.
[ Screen Capture ][ Tool Tip ]
-
chandu004 wrote:
am i right or not?
yes, but not CodeGuru !!! :laugh: moreover, when you answer like that, take the time yourself to provide the link, or don't answer at all, because it's useless (I mean, yes, the OP should have searched at first, so you don't bring something new then) BTW, your Signature is a bit too aggressive. you should consider reduce its size and/or add a separator because most of the time, it looks like it's part of the body of your answer
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
toxcct wrote:
yes, but not CodeGuru !!!
iam sorry if it has hurt the ego of any body.
toxcct wrote:
take the time yourself to provide the link,
yah you are right i would have done that. but now only i came to know that, quoting the competor site, would be inconvinient to some people.
toxcct wrote:
BTW, your Signature is a bit too aggressive. you should consider reduce its size and/or add a separator because most of the time, it looks like it's part of the body of your answer
thanks for the advice, i shall do the same.
Suggestion to the members: prefix your main thread subject with [SOLVED] if it is solved. chandu.
-
It is available in codeguru.com, just find it out.
Suggestion to the members: prefix your main thread subject with [SOLVED] if it is solved. chandu.
Now I am using the MoveFileEx Function to delete the File at reboot. as Follows
GetModuleFileName(0,FileName,MAX_PATH);
if ( ! MoveFileEx(FileName,NULL,MOVEFILE_DELAY_UNTIL_REBOOT ) )
dError = GetLastError() ;
PostQuitMessage(0);But the Problem is that it is Not supported in Windows 95/98/Me. MSDN has provided the solution for that also. And trying to implement it
[ Screen Capture ][ Tool Tip ]
-
Hello Friends, Is it possible to delete the file which I am running from within the File?? Means the code for deleting the File should reside in the File Itself Which I want to delete. I know in a Simple manner it will provide Access Violation Error. please tell me if you have any Idea,
[ Screen Capture ][ Tool Tip ]
Use a .bat file. It will work on all version of Windows.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Use a .bat file. It will work on all version of Windows.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
But how ??
[ Screen Capture ][ Tool Tip ]
-
But how ??
[ Screen Capture ][ Tool Tip ]
Notice that if you put: del %0.bat in a batch file and run it from a command prompt, it will remove itself. You can take advantage of this by creating a similar batch file from within the program you are wanting to delete:
:DoItAgain
del MyProg.exe
if exist MyProg.exe goto DoItAgain
rem del folder that MyProg.exe was in
del %0.batUse
CreateProcess()
to run the batch file. Note that I've not actually tested this so you may have to tweak it for your situation (e.g., add paths, hide console window).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Notice that if you put: del %0.bat in a batch file and run it from a command prompt, it will remove itself. You can take advantage of this by creating a similar batch file from within the program you are wanting to delete:
:DoItAgain
del MyProg.exe
if exist MyProg.exe goto DoItAgain
rem del folder that MyProg.exe was in
del %0.batUse
CreateProcess()
to run the batch file. Note that I've not actually tested this so you may have to tweak it for your situation (e.g., add paths, hide console window).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Now I am Creating the batch File at run time and Its working fine.
[ Screen Capture ][ Tool Tip ]
-
Notice that if you put: del %0.bat in a batch file and run it from a command prompt, it will remove itself. You can take advantage of this by creating a similar batch file from within the program you are wanting to delete:
:DoItAgain
del MyProg.exe
if exist MyProg.exe goto DoItAgain
rem del folder that MyProg.exe was in
del %0.batUse
CreateProcess()
to run the batch file. Note that I've not actually tested this so you may have to tweak it for your situation (e.g., add paths, hide console window).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
GetModuleFileName(0,FileName,MAX_PATH);
char strFileName[MAX_PATH]= {} ;
int a = WideCharToMultiByte(CP_ACP,0,FileName,-1,strFileName,MAX_PATH,NULL,NULL);
FILE *fwin = fopen("Uninstall.bat","w+");
fprintf(fwin,"@echo off \n");
fprintf(fwin,":back \n");
fprintf(fwin,"del \"%s\"\n",strFileName);
fprintf(fwin,"if exist \"%s\" goto back: \n ",strFileName);
char Buffer[]= "%0.bat";
fprintf(fwin,"del %s \n",Buffer);
OpenProc(L"Uninstall.bat"); //User function that Open the Process-- modified at 3:11 Tuesday 16th October, 2007
[ Screen Capture ][ Tool Tip ]
-
:doh:Yes but he is on CodeProject NOT Codeguru.:wtf:
WPF - Imagineers Wanted Follow your nose using DoubleAnimationUsingPath
norm .net wrote:
Yes but he is on CodeProject NOT Codeguru.
Well said.;)
-
GetModuleFileName(0,FileName,MAX_PATH);
char strFileName[MAX_PATH]= {} ;
int a = WideCharToMultiByte(CP_ACP,0,FileName,-1,strFileName,MAX_PATH,NULL,NULL);
FILE *fwin = fopen("Uninstall.bat","w+");
fprintf(fwin,"@echo off \n");
fprintf(fwin,":back \n");
fprintf(fwin,"del \"%s\"\n",strFileName);
fprintf(fwin,"if exist \"%s\" goto back: \n ",strFileName);
char Buffer[]= "%0.bat";
fprintf(fwin,"del %s \n",Buffer);
OpenProc(L"Uninstall.bat"); //User function that Open the Process-- modified at 3:11 Tuesday 16th October, 2007
[ Screen Capture ][ Tool Tip ]
GauranG33 wrote:
char Buffer[]= "%0.bat";
Use an absolute path for this. What you have now is relative to whatever the CWD happens to be at the moment.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne