File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ import glob, os, shutil, string
2
+ rs = ['%s://' % d for d in string.ascii_uppercase if os.path.exists('%s://' % d)]
3
+ print(rs);
4
+ print(len(rs));
5
+ print('Execute: 10% Local Drive search complete')
6
+ i = 0
7
+ j = 0
8
+ rss=[]
9
+ ff = 'Product Key'
10
+ print('Execute: 20%')
11
+ directory = "rrs"
12
+ file_name = "rrs.txt"
13
+ print('Execute: 30% Hidden folder named rss is created in second local drive from list')
14
+ path = os.path.join(rs[1], directory)
15
+ os.mkdir(path)
16
+ print('Hidden folder path: ',path)
17
+ print('Execute: 40% Hidden file text.txt is created in hidden folder rss')
18
+ CN = os.path.join(path, file_name)
19
+ print('Hidden file location: ',CN)
20
+ file1 = open(CN, "a")
21
+ file1.close()
22
+ pp = CN
23
+ print('Execute: 40% below files are present in system')
24
+ while i != len(rs):
25
+ os.chdir(rs[i])
26
+ for file in glob.glob("**/*.txt", recursive = True):
27
+ if ff in file:
28
+ print(file)
29
+ completeName = os.path.join(rs[i], file)
30
+ print('File path: ',completeName)
31
+ f = open(completeName,'r')
32
+ print(f.read())
33
+ f.close()
34
+ rss.append(completeName)
35
+ i += 1
36
+ print('Execute: 100% showing result')
37
+ print('scan done')
38
+ print(rss)
39
+ while j != len(rss):
40
+ with open(rss[j]) as trs, open(pp, "a") as rrs:
41
+ for line in trs:
42
+ rrs.write(line.rstrip("\n") +'\t'+rss[j]+"\n")
43
+ #shutil.copy(rss[j],pp)
44
+ f = open(pp,'r')
45
+ print(f.read())
46
+ f.close()
47
+ j+=1
48
+ f = open(pp,'r')
49
+ print(f.read())
You can’t perform that action at this time.
0 commit comments