Delete empty files in a folder

studio

#1

I want to delete empty files from a folder. Like empty text file excel file. how it can be achieved.


#2

Use Invoke Code activity and use a VB.net code something like below:

Dim info As New FileInfo("C:\Amalendu\Projects\NOV\AMS\Testing Team\Docs\New Text Document.txt")
Dim length As Long = info.Length

If(length = 0)
	info.Delete()
End If

Now one thing you need to do before it is get all the files inside a directory and loop through those files with the above code.


#3

Hi @Shashi123

Alternative way strictly with UiPath acitivties:
Delete empty files.xaml (8.9 KB)