프로그래밍/VB.NET

[VB.NET] 파일 자가 삭제

F0X 2022. 5. 25. 16:12
Private Sub DeleteFiles()

File.WriteAllText(Application.StartupPath & "\Delete.bat", vbNewLine & "del " & "파일명" & vbNewLine & "del Delete.bat")
Dim ProcessStartInfo = New ProcessStartInfo(Application.StartupPath & "\Delete.bat")

ProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(ProcessStartInfo)
End

End Sub

파일명 부분에는 삭제하고 싶으신 파일명을 넣으시면 됩니다.