diff --git a/lib/utils/os_startup.dart b/lib/utils/os_startup.dart index 699383b..5e946e3 100644 --- a/lib/utils/os_startup.dart +++ b/lib/utils/os_startup.dart @@ -345,8 +345,15 @@ Set WshShell = Nothing //delete vbs file var vbsInstallDir = Directory('$userPath$windowRoamingPath$label'); - if (await vbsInstallDir.exists()) { - await vbsInstallDir.delete(recursive: true); + var vbsFile = File(path.join(vbsInstallDir.path, '$label.vbs')); + if (await vbsFile.exists()) { + await vbsFile.delete(); + var list = vbsInstallDir.listSync(recursive: true); + if (list.isEmpty) { + if (await vbsInstallDir.exists()) { + await vbsInstallDir.delete(recursive: true); + } + } } //delete shorcut file