I need urgent help!
: I need urgent help!
You can delete a folder my using the command: Rmdir "c:yourpath"You can't remove a directory that has files in it though. You have todelete all the files first. You can do this with the kill statement.ie..Kill "c:yourpathfilename"You can also use wildcards with the kill statement to pick out certainfiles to delete in a folder. For example: Kill "c: emp*.bmp" woulddelete all .bmp files in the C: emp directory.As far as deleting files in directories and their subdirectories, I don't know.
To delete a folder you have to delete EVERY file and folder under it. This program can easily do this with a few modifications. Since it already searches out every file and folder, it is a simple matter to get every entry that ends with bmp or txt, etc. and delete them.
Just save this to a file with the extension frm and you should be able to load and run.
VERSION 2.00Begin Form CreateNw BackColor = &H00C0C0C0& BorderStyle = 3 'Fixed Double Caption = "Figure it out!" ClientHeight = 6150 ClientLeft = 2385 ClientTop = 1500 ClientWidth = 6990 Height = 6555 Left = 2325 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 6150 ScaleWidth = 6990 Top = 1155 Width = 7110 Begin DriveListBox Drive1 Height = 315 Left = 4920 TabIndex = 5 Top = 3480 Width = 1935 End Begin CommandButton Command2 Cancel = -1 'True Caption = "Sto&p" Height = 495 Left = 5280 TabIndex = 4 Top = 4800 Width = 1215 End Begin ListBox List1 Height = 5880 Left = 120 MultiSelect = 1 'Simple TabIndex = 0 Top = 120 Width = 4575 End Begin FileListBox File1 Height = 420 Hidden = -1 'True Left = 120 System = -1 'True TabIndex = 3 Top = 120 Width = 1215 End Begin CommandButton Command1 Caption = "&Search" Default = -1 'True Height = 495 Left = 5280 TabIndex = 2 Top = 4080 Width = 1215 End Begin DirListBox Dir1 ForeColor = &H00000000& Height = 3180 Left = 4920 TabIndex = 1 Top = 120 Width = 1935 End Begin Label Label1 Alignment = 2 'Center BackColor = &H00C0C0C0& Caption = "????" Height = 255 Left = 5400 TabIndex = 6 Top = 5520 Width = 975 EndEnd
Sub Command1_Click () Label1.Caption = "????" List1.Clear DoEvents SearchCur Label1.Caption = List1.ListCountEnd Sub
Sub Command2_Click () StopIt = TrueEnd Sub
Sub Dir1_Change () File1.Path = Dir1.PathEnd Sub
Sub Drive1_Change () Dir1.Path = Drive1.DriveEnd Sub
Sub Search () If StopIt Then StopIt = False Exit Sub End If For I = 0 To Dir1.ListCount - 1 Dir1.Path = Dir1.List(I) List1.AddItem Dir1.Path For X = 0 To File1.ListCount - 1 If Right$(Dir1.Path, 1) <> "" Then List1.AddItem Dir1.Path & "" & File1.List(X) Else List1.AddItem Dir1.Path & File1.List(X) End If Next X DoEvents If StopIt Then StopIt = False Exit Sub End If If Dir1.ListCount > 0 Then Search Dir1.Path = Dir1.List(-2) Next IEnd Sub
Sub SearchCur () List1.AddItem Dir1.Path For X = 0 To File1.ListCount - 1 If Right$(Dir1.Path, 1) <> "" Then List1.AddItem Dir1.Path & "" & File1.List(X) Else List1.AddItem Dir1.Path & File1.List(X) End If Next X SearchEnd Sub
Hope this helps!
It looks like you're new here. If you want to get involved, click one of these buttons!