Visual Basic 6 delete a file?
deoxis39
Posted messages
96
Status
Member
-
anonyme -
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
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
-
-
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 -
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-
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| -
-
-