private void writeWindowsCleanup ( File file , BufferedWriter bw ) throws IOException { bw . write ( "set max=30\n" ) ; bw . write ( "set cnt=0\n" ) ; bw . write ( "set dir=" + dir + "\n" ) ; bw . write ( "echo delete %dir%\n" ) ; bw . write ( ":while\n" ) ; bw . write ( " if exist %dir% (\n" ) ; bw . write ( " rmdir /s /q %dir%\n" ) ; bw . write ( " timeout 1\n" ) ; bw . write ( " set /a cnt+=1\n" ) ; bw . write ( " if %cnt% leq %max% (\n" ) ; bw . write ( " goto :while \n" ) ; bw . write ( " )\n" ) ; bw . write ( " )\n" ) ; bw . write ( "erase " + file . getAbsoluteFile ( ) + "\n" ) ; }
Write logic for windows cleanup script