I have used the following code to make a folder undeletable in my java project. It works fine. When I create an exe of my project the dos prompt doesn’t get disappeared.
cmd.exe /c start icacls "folder name" /e /c /d %username%
I also tried without opening the dos prompt. But it doesn’t work.
icacls ONGX32/winkrl /e /c /d %username%
I found a simple way. Created a .bat temporary file consists of that command. Used that .bat file. It didn’t open the command prompt.