That pipe thingy doesn't help my situation. All I need is a command or something that bypasses that "Are you sure? Y/N" -part.
That pipe thingy doesn't help my situation. All I need is a command or something that bypasses that "Are you sure? Y/N" -part.
You need to learn to be wayy more specific. How is it not working? What actually happens? Did you try both deltree and del? Do they both produce an "Are you sure? Y/N" message?
Having spent some more time thinking about the problem, I have figured out what was wrong with my solution. The dirty way to solve it would be to pipe in input that would answer the prompt for you. Otherwise, you're not going to bypass that part, and I don't recommend trying to pipe in the input.
Could you please just go back and try to understand the links that were given to you?
-- system(deltree C:\\WINDOWS\\Temp\Cookies" <- you mean this? -- Cmd says "deltree unknown function"You need to learn to be wayy more specific. How is it not working? What actually happens? Did you try both deltree and del? Do they both produce an "Are you sure? Y/N" message?
You seem to be missing a quote.
That's why you use the -Q quiet tag:Originally Posted by Overwhelm
Code:system("del -Q C:\\WINDOWS\\Temp\\Cookies > file.txt");
-- Here's the command and the result:That's why you use the -Q quiet tag:
Code:
Code:system("del -Q C:\\WINDOWS\\Temp\\Cookies > file.txt");
-> cmd says:Code:system("del -Q C:\\WINDOWS\\Temp\\Cookies");
-- So the -Q doesn't work somehow, so it mysteriously tries something with it in my Translator directory. And hence it still asks.File C:\Program Files\Dev-Cpp\-Q couldn't be found.
C:\WINDOWS\Temp\Cookies\* Are you sure (Y/N)?
AAAHHH!!
del Command
I'm so used to Linux tags having a: - in their tags!
It's actually:
I'm sorryCode:system("del /Q C:\\WINDOWS\\Temp\\Cookies");
Kleid-O,
Yes, it works now. (Odd though, I could swear I tested /Q also.)
But anyway it works, yet it doesn't delete subfolders. How's this done?
Most DOS programs use /s for that, but I can't confirm that for this particular one.
I think the following works (didn't test it).So here's the code that works, but it asks "Are you sure? Y/N" -- How to bypass this?
EDIT: lol, I didn't see there was a page 2 to this thread before I posted. My suggestion had already been suggestedCode:system("del C:\\WINDOWS\\Temp\\Cookies /Q");
Last edited by bithub; 01-17-2005 at 01:15 PM.
You use the /R Recursive tag to delete subfolders:Originally Posted by Overwhelm
The R may not delete the subfolders, but it deletes all of the contents within the subfolders. If you really want to delete the subfolders too (even though they'll be emptied), you'll want to create a batch file, but that's pretty advanced! Here's another alternative:Code:system("del /Q /R C:\\WINDOWS\\Temp\\Cookies");
Are you sure deltree doesn't exist as a command?
deltree Command Reference
If you can get the tool, try this:
/Y is just like /Q for the del function. It doesn't ask questions. I hope this helps you!Code:system("deltree /Y C:\\WINDOWS\\Temp\\Cookies");
I can't help but play devil's advocate on this, but reading this thread is generating a mental image of an email attachment with the ability to delete folders and subfolders quietly without confirmation from the enduser.
A brief review of this thread will shatter your confidence in his ability to create a self-replicating email capable of duping someone into actually downloading an unexpected exe as an email attachement.
Well the cookie/temporary internet files -deletion is now successfully completed.
Now what I need is a source code for 15 minute delay until it starts the deletion.
How is this done?
The source of the deletion:
-- Thanks.Code:#include <stdio.h> #include <cstdio> #include <conio.c> #include <iostream> #include <cstdlib> using namespace std; int main(int argc, char *argv[]) { system("del /Q /R C:\\WINDOWS\\TEMP\\Temporary Internet Files"); system("del /Q /R C:\\WINDOWS\\TEMP\\Cookies"); getche(); return 0; }
You use a sleep function. Google for one that suits your needs (i.e. you probably want one that lets the CPU use the puase time for other applications). Check out MSDN for some possibilities that will work on your system.
And don't make me want to take my previous post back. This is looking more and more like malware if you want something capable of making someone think that opening an executable and their files going missing are not connected because of the time difference. What is this for? If it's just for personal use for doing batch-type file management jobs, why do you need a 15 minute delay?