-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKingsoft WPS Ad Prevent.cpp
More file actions
65 lines (65 loc) · 2.19 KB
/
Kingsoft WPS Ad Prevent.cpp
File metadata and controls
65 lines (65 loc) · 2.19 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include<iostream>
#include<fstream>
#include<io.h>
#include<direct.h>
#include<windows.h>
#include<bits/stdc++.h>
using namespace std;
int main(){
string aa,bb,comm;
char charr;
string tmpstr;
system("whoami /user |find \"S-\" /i >temp_file.txt");
ifstream fin;
fin.open("temp_file.txt");
fin>>aa>>bb;
tmpstr="reg query HKEY_USERS\\"+bb+"\\Software\\Kingsoft\\Office\\6.0\\Common /v InstallRoot >temp_file.txt";
// cout<<tmpstr<<endl;
fin.close();
system(tmpstr.c_str());
fin.open("temp_file.txt");
fin>>aa>>aa>>aa>>charr;
getline(fin,bb);
if(charr>='a'&&charr<='z' || charr>='A'&&charr<='Z') bb=charr+bb;
// cout<<bb<<endl;
fin.close();
system("del temp_file.txt /q /f");
ofstream fout;
fout.open("tmp_run.bat");
comm = bb[0];
fout<<"@echo off"<<endl;
comm = comm+":";
fout<<comm<<endl;
comm = "cd \"" + bb + "\\office6\"";//E:\Èí¼þ\½ðɽ WPS\WPS Office\10.1.0.7400
fout<<comm<<endl;
fout<<"taskkill /im wpscenter.exe /f"<<endl;
fout<<"taskkill /im wpscloudlaunch.exe /f"<<endl;
fout<<"taskkill /im wpscloudsvr.exe /f"<<endl;
fout<<"taskkill /im wpsrenderer.exe /f"<<endl;
fout<<"ren wpscenter.exe wpscenter_backup.exe"<<endl;
fout<<"ren wpscloudlaunch.exe wpscloudlaunch_backup.exe"<<endl;
fout<<"ren wpscloudsvr.exe wpscloudsvr_backup.exe"<<endl;
fout<<"ren wpsrenderer.exe wpsrenderer_backup.exe"<<endl;
fout<<"cd ..\\wtoolex"<<endl;
fout<<"taskkill /im wpsnotify.exe /f"<<endl;
fout<<"ren wpsnotify.exe wpsnotify_backup.exe"<<endl;
// fout<<"echo. >wpsnotify.exe"<<endl;
// fout<<"attrib wpsnotify.exe +a +r +s"<<endl;
fout<<"taskkill /im desktoptip.exe /f"<<endl;
fout<<"ren desktoptip.exe desktoptip_backup.exe"<<endl;
// fout<<"echo. >desktoptip.exe"<<endl;
// fout<<"attrib desktoptip.exe +a +r +s"<<endl;
fout<<"cd ..\\"<<endl;
fout<<"xcopy wtoolex wtoolex_backup /s /v /h /k /y /i /q"<<endl;
// fout<<"attrib wtoolex\\desktoptip.exe -s -h -a -r";
// fout<<"attrib wtoolex\\wpsnotify.exe -s -h -a -r";
string del_path = bb +"\\wtoolex";
// rmdir(del_path.c_str());
comm="rd \""+del_path+"\" /q /s";
fout<<comm<<endl;
fout<<"pause"<<endl;
fout.close();
system("tmp_run.bat");
system("del tmp_run.bat /f /q");
return 0;
}