1 Reset the trial period of IDEA.vbs
Set wsshell = CreateObject("WScript.Shell")
Set filesys = CreateObject("Scripting.FileSystemObject")
USERPROFILE = wsshell.ExpandEnvironmentStrings("%USERPROFILE%")
APPDATA = wsshell.ExpandEnvironmentStrings("%APPDATA%") + "\JetBrains"
Set reg = New RegExp
reg.Global = True
reg.IgnoreCase = True
reg.Pattern = "\.?(IntelliJIdea|WebStorm|PyCharm|GoLand|CLion|DataGrip|RubyMine|AppCode|PhpStorm|Rider).*"
Sub rmtree(ByVal f, ByVal path)
bMatch = reg.Test(f.Name)
If Not bMatch Then
Exit Sub
End If
If filesys.FolderExists(path) Then
filesys.DeleteFolder path, True
End If
End Sub
If filesys.FolderExists(USERPROFILE) Then
For Each f In filesys.GetFolder(USERPROFILE).SubFolders
rmtree f, USERPROFILE + "\" + f.Name + "\config\eval"
Next
End If
If filesys.FolderExists(APPDATA) Then
For Each f In filesys.GetFolder(APPDATA).SubFolders
rmtree f, APPDATA + "\" + f.Name + "\eval"
Next
End If
MsgBox "Reset the trial period of IDEA succeeded !"
2 Reset the trial period of IDEA.py
# !/usr/bin/python3
import os
import re
import shutil
import time
USERPROFILE = os.getenv('USERPROFILE')
APPDATA = os.getenv('APPDATA') + r'\JetBrains'
PATTERN = r'.?(IntelliJIdea|WebStorm|PyCharm|GoLand|CLion|DataGrip|RubyMine|AppCode|PhpStorm|Rider).*'
def match(char):
if re.search(PATTERN, char, re.IGNORECASE):
return True
return False
LIST = []
if os.path.isdir(USERPROFILE):
print('SCAN %s' % USERPROFILE)
fd = os.listdir(USERPROFILE)
for f in fd:
if match(f):
p = USERPROFILE + '\\' + f + r'\config\eval'
LIST.append(p)
if os.path.isdir(APPDATA):
print('SCAN %s' % APPDATA)
fd = os.listdir(APPDATA)
for f in fd:
if match(f):
p = APPDATA + '\\' + f + r'\eval'
LIST.append(p)
if __name__ == '__main__':
print('\n Reset the trial period of IDEA\n')
while LIST:
for p in LIST:
if os.path.isdir(p):
print('REMOVE %s' % p)
shutil.rmtree(p)
print('SUCCEED ヽ(●´ε`●)ノ\(@ ̄∇ ̄@)/!')
time.sleep(5)
print(' o(╯□╰)oo(︶︿︶)o')
可以
pyinstaller -F '.\Reset the trial period of IDEA.py'