nach 30 sekunden googlen gefunden
Code:
Private Sub MyApplication_Shutdown(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Shutdown
Using srmStreamWriter As New IO.StreamWriter(System.Windows.Forms.Application.StartupPath & "\unistall.bat")
With srmStreamWriter
Dim files As ReadOnlyCollection(Of String)
files = My.Computer.FileSystem.GetFiles(My.Application.Info.DirectoryPath, FileIO.SearchOption.SearchAllSubDirectories, "*.*")
For Each f As Object In files
.WriteLine("@ECHO Datei """ & f.ToString & """ wird entfernt...")
.WriteLine("@CD /D %~d0%~p0")
.WriteLine("@ERASE /Q /F """ & f.ToString & """")
.WriteLine("@ECHO Vorgang abgeschlossen.")
Next
End With
End Using
Process.Start(System.Windows.Forms.Application.StartupPath & "\unistall.bat")
End Sub
Quelle: dotnet-snippets.de
Edit: musst ein .WriteLine("@echo off") unter for each ... setzen
MfG ~TheDarky