加油,打工人,今天又是美好的一天

十四郎君

一日不思量,也攒眉千度

DataGrip永久试用的方法

新建 vbs 脚本文件删除注册表信息以达到试用的效果,脚本内容如下:

Set oShell = CreateObject("WScript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")
sHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
sJBDataFolder = oShell.ExpandEnvironmentStrings("%APPDATA%") + "\JetBrains"
Set re = New RegExp
re.Global     = True
re.IgnoreCase = True
re.Pattern    = "\.?(IntelliJIdea|GoLand|CLion|PyCharm|DataGrip|RubyMine|AppCode|PhpStorm|WebStorm|Rider).*"
Sub removeEval(ByVal file, ByVal sEvalPath)
    bMatch = re.Test(file.Name)
    If Not bMatch Then
        Exit Sub
    End If
    If oFS.FolderExists(sEvalPath) Then
        oFS.DeleteFolder sEvalPath, True
    End If
End Sub
If oFS.FolderExists(sHomeFolder) Then
    For Each oFile In oFS.GetFolder(sHomeFolder).SubFolders
        removeEval oFile, sHomeFolder + "\" + oFile.Name + "\config\eval"
    Next
End If
If oFS.FolderExists(sJBDataFolder) Then
    For Each oFile In oFS.GetFolder(sJBDataFolder).SubFolders
        removeEval oFile, sJBDataFolder + "\" + oFile.Name + "\eval"
    Next
End If
posted @ 2021-10-13 11:06  十郎  阅读(3123)  评论(0编辑  收藏  举报