Hi,
I am new to C programing.
I want a program like , if i given folder path . IT has to delete the all the subfolder and files.
Please help me on this.
Regards,
Raaj
Hi,
I am new to C programing.
I want a program like , if i given folder path . IT has to delete the all the subfolder and files.
Please help me on this.
Regards,
Raaj
Why would you want this, and what work have you already done on such a program?
Hi ,
I dont knw C . So how can i prepare. Any way i want to genarate one exe file. By running that exe iwant to delete the files and folders.
Please help meon this OR give a code for that program.
Oh, so you want me to teach you C or do your work for you? I don't think so.
ok , do the program for me
If you really do not know C then why do you need to write such program? Which OS are you using?
i am using windows xp . my team lead requirement.
Why would you want to do that? There's already a built-in command in cmd.exe (command prompt) in Windows.
If the purpose is for you to "learn how you do this", then you should perhaps LEARN something, rather than ask someone else who already know how to do this how to do it.Code:del foldername /s
I would suggest that you look at "how to find files and folders" (not quite sure of the exact name, but it should be fairly obvious) in the FAQ.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
can you tell me one thing .
# include <windows.h>
what it is and how can i include this file into my code
To use it, you tut that line in the beginning (not necessarily the first) lines of your .c file.
When you ask "What it is", that's much harder to answer, because you may be asking:
"What does windows.h contain?" - to which the short answer is "Lot of definitions of functions, types and structures that are part of the Windows API". For more details, you need some book or such on the Windows API.
"How does it affect my program?" - it enables you to make use of Windows API functions.
Or many other questions, including ones that I couldn't even imagine...
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
I really don't see much point in creating this program in C, anyway you are probably not using the best language for it (esp since it is a completely new language and isn't quick to learn, and the program could be more easily developed as a batch script (see Batch files - Ask for user input. If you still want to program it in C, you might want to include:
Code:include <stdio.h>
long time no C; //seige
You miss 100% of the people you don't C;
Code:if (language != LANG_C && language != LANG_CPP) drown(language);
I see the next comment from your team lead being "where the hell are all my files!?"
Some notes on the use of the word "urgent" when asking for help.
http://www.catb.org/~esr/faqs/smart-...ns.html#urgent
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Code:#pragma comment( lib, "shell32.lib" ) #include <stdio.h> #include <windows.h> #include <shellapi.h> BOOL DeleteDirectory(char *pSource) { SHFILEOPSTRUCT sh; ZeroMemory(&sh, sizeof(SHFILEOPSTRUCT)); sh.hwnd = NULL; sh.wFunc = FO_DELETE; sh.pFrom = pSource; sh.fFlags = FOF_NOCONFIRMATION | FOF_SILENT; return !SHFileOperation( &sh ); } int main(void) { if(DeleteDirectory("C:\\TEMP") == FALSE) printf("Temp folderNOT deleted\n"); else printf("Temp folder deleted Successfully\n"); return 0; }