Código:
String ruta="C:/Cotizatel/LICENCIA.exe";
File file = new File (ruta);
if(!file.exists())
{
System.out.println("No existe");
FileWriter fw = new FileWriter (file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
String p=password;
char array[]=p.toCharArray();
for(int m=0;m<array.length;m++)
{
array[m]=(char)(array[m]+(char)5);
}
String cifrado =String.valueOf(array);
p=cifrado;
try
{
Runtime.getRuntime().exec("attrib +H +R "+ruta);
}
catch(Exception e)
{
}
bw.write(p);
bw.close();
fw.close();
System.out.println("Creado correctamente");
}