Visual Basic 6 delete a file?

deoxis39 Posted messages 96 Status Member -  
 anonyme -
Hello, I would like to delete a file but what should I write
I think it starts with the shell but I don’t know the rest
thanks in advance

Configuration: Windows 7 / Firefox 3.6.3

3 answers

  1. deoxis39 Posted messages 96 Status Member 43
     
    more please ^^
    _
    0
  2. Polux31 Posted messages 7219 Status Member 1 204
     
    Hello,

     Sub SuppFile(ByVal pFullPath As String) Dim ofs As Object Dim of As Object Set ofs = CreateObject("Scripting.FileSystemObject") Set of = ofs.GetFile(pFullPath) of.Delete Set ofs = Nothing Set of =Nothing End Sub 


    ;o)
    --
    “What is conceived clearly is stated clearly, and the words to say it arrive easily.”
    Nicolas Boileau
    0
  3. deoxis39 Posted messages 96 Status Member 43
     
    and where do I put what I want to delete?
    but so that you know I want to make it so that when we click on a button
    it deletes a file
    0
    1. Polux31 Posted messages 7219 Status Member 1 204
       
      Private Sub Command1_Click() SuppFile ("C:\temp\monfichierasupprimer.txt") End Sub


      No kidding, what do you think? That it’s enough to put buttons all over a Form to make a program?

      There is still a minimum of basics to know. For example the algorithm, what an input or output parameter is by value or by reference etc ... Obviously, it takes work.

      :o|
      0
    2. deoxis39 Posted messages 96 Status Member 43
       
      I know a little about the basics, it's just that I forgot.
      0
    3. anonyme
       
      kill "c:\............................................................\fichierasupprimer.txt"
      0