-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFolder.java
More file actions
28 lines (27 loc) · 873 Bytes
/
Folder.java
File metadata and controls
28 lines (27 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
class Folder{
public static void main(String ... s) throws Exception{
String date=DateTimeFormatter.ofPattern("dd MM yyyy").format(LocalDateTime.now());
File f=new File("a.txt");
String d=new Scanner(f).nextLine();
String str="Day "+d+" - "+date+"";
File file=new File(str);
if(file.mkdirs()){
PrintWriter out=new PrintWriter(f);
out.println(Integer.parseInt(d)+1);
out.close();
out=new PrintWriter("copier.bat");
out.println("echo "+str+"|clip");
out.close();
new PrintWriter(new File(str+"\\Contents.txt")).close();
Runtime r=Runtime.getRuntime();
r.exec("explorer .\\"+str);
Thread.sleep(700);
r.exec("notepad "+str+"\\Contents.txt");
}
}
}