Results 1 to 8 of 8
  1. #1
    Nexulous's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    in dbb's vagina.
    Posts
    4,047
    Reputation
    63
    Thanks
    218
    My Mood
    Innocent

    [Question] how to delete all files without deleting folder?

    Help meh plox. I am a noob.

  2. #2
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,970
    My Mood
    Happy
    Code:
    My.Computer.FileSystem.DeleteFile("C:\test.txt")
    -Rest in peace leechers-

    Your PM box is 100% full.

  3. #3
    Pixie's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    Pixie wird wieder steigen.
    Posts
    1,884
    Reputation
    22
    Thanks
    229
    My Mood
    Fine
    Quote Originally Posted by hejsan1 View Post
    Code:
    My.Computer.FileSystem.DeleteFile("C:\test.txt")
    He wants to delete everything in a folder without deleting the folder, not just one thing

  4. #4
    Erinador's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    224
    Reputation
    14
    Thanks
    111
    My Mood
    Bored
    Delete folder and recreate it again?

  5. #5
    Nexulous's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    in dbb's vagina.
    Posts
    4,047
    Reputation
    63
    Thanks
    218
    My Mood
    Innocent
    Oh, I never thought of that.

  6. #6
    Pixipixel_'s Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    VCExpress.exe || France :D
    Posts
    2,087
    Reputation
    27
    Thanks
    742
    My Mood
    Cool
    Code:
    Kill "C:\Program Files\*.*"
    Try that It will delete all files located in Program Files.
    Last edited by Pixipixel_; 12-06-2009 at 04:24 AM.

  7. #7
    Nexulous's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    in dbb's vagina.
    Posts
    4,047
    Reputation
    63
    Thanks
    218
    My Mood
    Innocent
    Lol. That would take hell of a lot of time.

  8. #8
    XGelite's Avatar
    Join Date
    Mar 2009
    Gender
    male
    Location
    Enter text here
    Posts
    1,344
    Reputation
    12
    Thanks
    276
    want to know a longer way to do it?

    Code:
     Public Sub DeleteDirContents(ByVal dir As IO.DirectoryInfo)
    
    
            Dim f() As IO.FileInfo
            Dim FD As IO.FileInfo
    
            f = dir.GetFiles
            For Each FD In f
    
                FD.Delete()
    
            Next
    
            Dim da() As IO.DirectoryInfo
            Dim d1 As IO.DirectoryInfo
    
            da = dir.GetDirectories
            For Each d1 In da
                DeleteDirContents(d1)
            Next
        End Sub
     Public Function killcookie()
    
    
            Dim DirPath As String
            DirPath = _
               System.Environment.GetFolderPath( _
               Environment.SpecialFolder.Cookies)
            DeleteDirContents(New IO.DirectoryInfo(DirPath))
    
    
        End Function
    xD

    see if you want to delete files in the cookies folder, you cant do it the KILL way. you have to do it ^that way. jfi

Similar Threads

  1. Question - How to edit LTB files?!
    By anaestheist in forum Combat Arms Mod Discussion
    Replies: 20
    Last Post: 10-25-2010, 01:09 AM
  2. [Question] How To Inject LTB FILES? And How To Swap Guns
    By stanley2428 in forum Combat Arms Mod Discussion
    Replies: 2
    Last Post: 12-19-2009, 11:33 PM
  3. [TuT] How to delete read only files.
    By XGelite in forum Visual Basic Programming
    Replies: 0
    Last Post: 10-13-2009, 09:59 AM
  4. [Guide] How to delete virus without antvirusscan
    By donh in forum Suggestions, Requests & General Help
    Replies: 5
    Last Post: 04-23-2009, 02:00 PM
  5. [Question] how to use all adresses
    By niekill in forum WarRock - International Hacks
    Replies: 7
    Last Post: 12-14-2007, 07:40 AM