Advertisement
LightProgrammer000

Bloco de notas [desktop]

May 11th, 2020
1,840
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. // Execução de Comandos [.bat]: Tela de prompt
  2. try
  3. {
  4.     Runtime.getRuntime().exec("cmd /c \"echo ========= Anotacoes ========= > %userprofile%\\desktop\\oi.txt\"");
  5.     Runtime.getRuntime().exec("cmd /c \"echo Computador: %computername% >> %userprofile%\\desktop\\oi.txt\"");
  6.     Runtime.getRuntime().exec("cmd /c \"echo Diretorio: %userprofile% >> %userprofile%\\desktop\\oi.txt\"");
  7.     Runtime.getRuntime().exec("cmd /c \"echo Nome: %username% >> %userprofile%\\desktop\\oi.txt\"");
  8.     Runtime.getRuntime().exec("cmd /c \"echo. >> %userprofile%\\desktop\\oi.txt\"");
  9. }
  10.  
  11. catch(IOException e)
  12. {
  13.     System.err.println(e);      
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement