Shoutbox

Delete File in VB6 - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Delete File in VB6 (/showthread.php?tid=43540)

Delete File in VB6 by Iccler on 04-24-2005 at 12:14 PM

I need help deleting a file using VB6. For example, I want to delete C:\doc.txt
Can anyone help me?


RE: Delete File in VB6 by Millenium_edition on 04-24-2005 at 12:17 PM

You can use

code:
Kill "c:\doc.txt"

RE: Delete File in VB6 by Iccler on 04-24-2005 at 12:20 PM

Thanks a lot, just missed the quotes.


RE: Delete File in VB6 by Fergy on 04-24-2005 at 04:07 PM

Can it be used to delete directories?


RE: Delete File in VB6 by Millenium_edition on 04-24-2005 at 04:08 PM

No, you have to delete every file in every subdirectory, then remove the subdirectories and then remove the dir

code:
RmDir "c:\bla\"
' c:\bla is empty

RE: Delete File in VB6 by Fergy on 04-24-2005 at 04:37 PM

okay, thanks for the help


RE: Delete File in VB6 by Wabz on 04-24-2005 at 06:10 PM

quote:
Originally posted by Millenium_edition
No, you have to delete every file in every subdirectory, then remove the subdirectories and then remove the dir

code:
RmDir "c:\bla\"
' c:\bla is empty


Blah thats complicated.  I'm making a questionaire program at the moment  and its my first dealing with multiple forms and saving data its a nightmare and I don't even know where to start
RE: Delete File in VB6 by Ahmad on 04-24-2005 at 06:18 PM

quote:
Originally posted by Millenium_edition
No, you have to delete every file in every subdirectory, then remove the subdirectories and then remove the dir

code:
RmDir "c:\bla\"
' c:\bla is empty


Use..
code:
ChDir "c:\bla\"
Kill "c:\bla\*.*"
ChDir "c:\"
RmDir "c:\bla\"
or something like that
RE: Delete File in VB6 by Millenium_edition on 04-24-2005 at 06:43 PM

quote:
Originally posted by Ahmad
quote:
Originally posted by Millenium_edition
No, you have to delete every file in every subdirectory, then remove the subdirectories and then remove the dir

code:
RmDir "c:\bla\"
' c:\bla is empty


Use..
code:
ChDir "c:\bla\"
Kill "c:\bla\*.*"
ChDir "c:\"
RmDir "c:\bla\"
or something like that
that won't work if the directory has subdirectories.
you have to use dir() to enumerate all the folders & files and then delete every single one of them
RE: delete file in vb by Dulanjana on 05-29-2010 at 05:00 PM

i need to know how to copy file in vb?


RE: Delete File in VB6 by toddy on 05-29-2010 at 05:11 PM

filecopy [fromfile],[tofile]