Deleting file

CareWrm
09-06-2003, 06:48 PM
What is the Code to delete a file say like

Delete, "D:\Music.mp3"

Somthing like that just to delete a file????

Also what is the Code to Restart windows into dos?

BKSwindell
09-06-2003, 06:58 PM
What is the Code to delete a file say like

Delete, "D:\Music.mp3"

Somthing like that just to delete a file????

Also what is the Code to Restart windows into dos?

Look up Kill

Kill "D:\Music.mp3"

CareWrm
09-06-2003, 07:02 PM
Thanks

how about restarting into dos?

CareWrm
09-06-2003, 07:12 PM
I'm trying to make it so u can put a file path like "d:\pic.gif" into a textbox and press the button and that file will b deleted...

i have it like so -

Dim iKill As Integer


Private Sub Command1_Click()

iKill = Val(Text1.Text)

Kill "iKill"

End Sub

and it don't work cuz it thinks the dim is the path so how can i do it???

One thread is enough for now

Val
09-06-2003, 07:38 PM
What is the point of running a Kill command on an integer? What are you trying to accomplish with that?

Sub cmdDelete_Click()
On Error Resume Next 'If file doesn't exist, ignore
Kill txtFileName.Text
End Sub

BlueDragon
09-06-2003, 08:10 PM
If you are using XP, there is no restarting into DOS

BKSwindell
09-06-2003, 10:18 PM
Try this:Dim iKill As String

Private Sub Command1_Click()
iKill = Text1.Text
Kill iKill
End SubHere is an example:

zak2zak
09-07-2003, 08:26 AM
U should make a check for existing file.
U may not know that u have clicked the button twice?

Private Sub Command1_Click()
If Dir(Text1.Text) <>"" then
Kill Text1.text
End If
End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum