无限重置IDEA试用期的小脚本

这两个脚本(vbs和py)用于重置JetBrains IDE的试用期。它们遍历用户配置文件夹,查找并删除指定IDE的评估(eval)目录,从而达到重置试用期的目的。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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'

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值