To do that you have to get down to the nitty-gritty with the operating system. The curses library (*nix) or ncurses (MS-Windows) will make that easier for you. For MS-Windows there are several other options depending on the compiler you are using.
if your developing for windows and don't wanna go download some extra libraries and things then you can use the Win32 API. It give's you all the stuff you need to do this, just if your a beginner it might be a little complex.
**how to solve invalid keystore error in android studio here is error report----------------------->
here is error report--------> error:Error:java.lang.RuntimeException: com.android.ide.common.signing.KeytoolException: Failed to read key palash from store "D:\MyApplication3.idea\workspace.xml": Invalid keystore format ...