Thread: A small issue.

  1. #16
    Registered User
    Join Date
    Jan 2005
    Posts
    23
    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.

  2. #17
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    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?

  3. #18
    Registered User
    Join Date
    Jan 2005
    Posts
    23
    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?
    -- system(deltree C:\\WINDOWS\\Temp\Cookies" <- you mean this? -- Cmd says "deltree unknown function"

  4. #19
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    You seem to be missing a quote.

  5. #20
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    Posts
    656
    Quote Originally Posted by Overwhelm
    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's why you use the -Q quiet tag:
    Code:
    system("del -Q C:\\WINDOWS\\Temp\\Cookies > file.txt");

  6. #21
    Registered User
    Join Date
    Jan 2005
    Posts
    23
    That's why you use the -Q quiet tag:

    Code:
    Code:
    system("del -Q C:\\WINDOWS\\Temp\\Cookies > file.txt");
    -- Here's the command and the result:

    Code:
    system("del -Q C:\\WINDOWS\\Temp\\Cookies");
    -> cmd says:

    File C:\Program Files\Dev-Cpp\-Q couldn't be found.
    C:\WINDOWS\Temp\Cookies\* Are you sure (Y/N)?
    -- So the -Q doesn't work somehow, so it mysteriously tries something with it in my Translator directory. And hence it still asks.

  7. #22
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    Posts
    656
    AAAHHH!!
    del Command
    I'm so used to Linux tags having a: - in their tags!
    It's actually:
    Code:
    system("del /Q C:\\WINDOWS\\Temp\\Cookies");
    I'm sorry

  8. #23
    Registered User
    Join Date
    Jan 2005
    Posts
    23
    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?

  9. #24
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Most DOS programs use /s for that, but I can't confirm that for this particular one.

  10. #25
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    So here's the code that works, but it asks "Are you sure? Y/N" -- How to bypass this?
    I think the following works (didn't test it).
    Code:
    system("del C:\\WINDOWS\\Temp\\Cookies /Q");
    EDIT: lol, I didn't see there was a page 2 to this thread before I posted. My suggestion had already been suggested
    Last edited by bithub; 01-17-2005 at 01:15 PM.

  11. #26
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    Posts
    656
    Quote Originally Posted by Overwhelm
    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?
    You use the /R Recursive tag to delete subfolders:
    Code:
    system("del /Q /R C:\\WINDOWS\\Temp\\Cookies");
    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:

    Are you sure deltree doesn't exist as a command?
    deltree Command Reference
    If you can get the tool, try this:
    Code:
    system("deltree /Y C:\\WINDOWS\\Temp\\Cookies");
    /Y is just like /Q for the del function. It doesn't ask questions. I hope this helps you!

  12. #27
    Registered User Scribbler's Avatar
    Join Date
    Sep 2004
    Location
    Aurora CO
    Posts
    266
    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.

  13. #28
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    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.

  14. #29
    Registered User
    Join Date
    Jan 2005
    Posts
    23
    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:

    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;
    }
    -- Thanks.

  15. #30
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    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?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. float calculation issue
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-26-2008, 04:56 AM
  2. Small Logic Issue
    By Flakster in forum C++ Programming
    Replies: 5
    Last Post: 05-29-2006, 02:40 PM
  3. Newb With Small Pointer Issue
    By G-Prime in forum C Programming
    Replies: 7
    Last Post: 09-06-2004, 04:09 PM
  4. help with small program. array issue
    By InvariantLoop in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2004, 12:26 PM
  5. Small issue with system()
    By Metal Man in forum C++ Programming
    Replies: 8
    Last Post: 10-21-2003, 01:33 PM