无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 346|回复: 8
打印 上一主题 下一主题

这个启动器可以带着自己的用户信息移动使用(JJ游戏的)

[复制链接]
跳转到指定楼层
1#
发表于 14 小时前 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 窄口牛 于 2025-7-17 07:14 编辑

On Error Resume Next
Dim objFSO, objShell, appDataPath, jjgamePath, scriptPath, mainProcessId, jjgameBackupPath
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Dim objWMIService
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
appDataPath = objShell.ExpandEnvironmentStrings("%APPDATA%")
jjgamePath = appDataPath & "\JJGame"
jjgameBackupPath = appDataPath & "\JJGame-back"
scriptPath = objFSO.GetParentFolderName(WScript.ScriptFullName)
HandleJJGamePath
RunModule
Sub HandleJJGamePath
    Dim targetPath
    targetPath = scriptPath & "\用户数据\Users\Administrator\AppData\Roaming\JJGame"
    If Not objFSO.FolderExists(targetPath) Then
        objFSO.CreateFolder(targetPath)
    End If
    If objFSO.FolderExists(jjgamePath) Then
        Dim isLink, actualTarget
        isLink = False
        actualTarget = ""
        Dim cmd, linkCheck, linkOutput
        Set linkCheck = objShell.Exec("cmd /c dir /aL """ & appDataPath & """ | findstr /i ""JJGame""")
        linkOutput = linkCheck.StdOut.ReadAll()
         If InStr(linkOutput, "<SYMLINKD>") > 0 Then
            isLink = True
            Dim lines, i, parts
            lines = Split(linkOutput, vbCrLf)
            For i = 0 To UBound(lines)
                If InStr(lines(i), "<SYMLINKD>") > 0 Then
                    parts = Split(lines(i), "[")
                    If UBound(parts) >= 1 Then
                        actualTarget = Trim(Replace(parts(1), "]""", ""))
                        Exit For
                    End If
                End If
            Next
        End If
        If isLink Then
            If Not PathCompare(actualTarget, targetPath) Then
                objShell.Run "cmd /c rmdir """ & jjgamePath & """", 0, True
                CreateSymbolicLink targetPath, jjgamePath
            End If
        Else
            If objFSO.FolderExists(jjgameBackupPath) Then
                objFSO.DeleteFolder jjgameBackupPath, True
            End If
            objFSO.MoveFolder jjgamePath, jjgameBackupPath
            CreateSymbolicLink targetPath, jjgamePath
        End If
    ElseIf Not objFSO.FolderExists(jjgamePath) Then
        CreateSymbolicLink targetPath, jjgamePath
    End If
End Sub
Function PathCompare(path1, path2)
    PathCompare = (path1 = path2)
End Function
Sub CreateSymbolicLink(targetPath, linkPath)
    Dim linkCommand, returnCode
    linkCommand = "cmd /c mklink /d """ & linkPath & """ """ & targetPath & """"
    returnCode = objShell.Run(linkCommand, 0, True)
    If returnCode <> 0 Then
        MsgBox "符号链接创建失败,请以管理员权限运行!" & Err.Description
        WScript.Quit
    End If
End Sub
Sub RunModule
    Dim loaderDir
    loaderDir = scriptPath & "\大家乐JJ游戏助手"
    objShell.CurrentDirectory = loaderDir
    Dim loaderPath
    loaderPath = scriptPath & "\大家乐JJ游戏助手\DJL_Loader.exe"
    If objFSO.FileExists(loaderPath) Then
        objShell.Run "cmd /c start """" /D """ & loaderDir & """ """ & loaderPath & """", 0, False
        WScript.Sleep 200
    End If
    Dim lobbyPath, objProcess
    lobbyPath = scriptPath & "\TKLobby.exe"
    If objFSO.FileExists(lobbyPath) Then
        Set objProcess = objWMIService.Get("Win32_Process")
        objProcess.Create lobbyPath, Null, Null, mainProcessId
        WScript.Sleep 800
        KillProcess "DJL_Auxiliary.exe"
        KillProcess "AgentStarter.exe"
        KillProcess "TKStatistics.exe"
        KillProcess "TKAssistor.exe"
        KillProcess "AgentStarter.exe"
        WScript.Sleep 200   
        Dim sourceExe, destPath
        sourceExe = scriptPath & "\打开.exe"
        If objFSO.FileExists(sourceExe) Then
            objFSO.CopyFile sourceExe, scriptPath & "\TKStatistics.exe", True
            objFSO.CopyFile sourceExe, scriptPath & "\TKAssistor.exe", True
            objFSO.CopyFile sourceExe, scriptPath & "\大家乐JJ游戏助手\DJL_Auxiliary.exe", True
        End If
        WaitForProcessExit mainProcessId
    End If
   RestoreJJGameBackup
    KillProcess "DJL_Loader.exe"
    KillProcess "TKCltNet.exe"
    KillProcess "TKStatistics.exe"
    KillProcess "TKAssistor.exe"
    KillProcess "AgentStarter.exe"
    KillProcess "qtcefwing.exe"
End Sub
Sub RestoreJJGameBackup()
    Dim isLink, result, cmd
    If objFSO.FolderExists(jjgamePath) Then
        If objFSO.FolderExists(jjgamePath) Or objFSO.FileExists(jjgamePath) Then
            Set cmd = objShell.Exec("cmd /c dir /aL """ & appDataPath & """ | findstr /i ""JJGame""")
            result = cmd.StdOut.ReadAll()
             isLink = (InStr(result, "<SYMLINKD>") > 0)
            If isLink Then
                On Error Resume Next
                objShell.Run "cmd /c rmdir """ & jjgamePath & """", 0, True
            End If
        End If
        On Error Resume Next
        objFSO.MoveFolder jjgameBackupPath, jjgamePath
        If Err.Number <> 0 Then
            Err.Clear
        End If
        On Error GoTo 0
    End If
End Sub
Sub WaitForProcessExit(processId)
    Dim colProcesses
    Set colProcesses = objWMIService.ExecNotificationQuery( _
        "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE " & _
        "TargetInstance ISA 'Win32_Process' AND " & _
        "TargetInstance.ProcessID = " & processId)
    colProcesses.NextEvent
End Sub
Sub KillProcess(processName)
    Dim wmi, processes, result
    Set wmi = GetObject("winmgmts:\\.\root\cimv2")
    Set processes = wmi.ExecQuery("SELECT * FROM Win32_Process WHERE Name='" & processName & "'")
    For Each p In processes
        result = p.Terminate
        If result = 0 Then
            WScript.Sleep 500
        End If
    Next
End Sub
它会检测现在系统里的用户数据路径,关闭无用副进程,并修改副进程为无法执行的exe文件,最后无痕处理,对系统毫无改变。
附赠一个选择用户数据,拷贝到批处理所在文件夹(带完整目录结构)。
启动游戏.rar (2.39 KB, 下载次数: 4)


2#
发表于 13 小时前 | 只看该作者
沙发啊
回复

使用道具 举报

3#
发表于 12 小时前 | 只看该作者
谢谢楼主分享
回复

使用道具 举报

4#
发表于 10 小时前 来自手机 | 只看该作者
什么游戏?没听说过

点评

JJ斗地主,升级,棋盘游戏;这个主要是提供思路,处理运行的软件。  详情 回复 发表于 10 小时前
回复

使用道具 举报

5#
 楼主| 发表于 10 小时前 来自手机 | 只看该作者
nttwqz 发表于 2025-7-17 10:54
什么游戏?没听说过

JJ斗地主,升级,棋盘游戏;这个主要是提供思路,处理运行的软件。
回复

使用道具 举报

6#
发表于 9 小时前 | 只看该作者
感谢楼主分享 !!
回复

使用道具 举报

7#
发表于 9 小时前 | 只看该作者
感谢分享 !
回复

使用道具 举报

8#
发表于 8 小时前 | 只看该作者
路过看看
回复

使用道具 举报

9#
发表于 8 小时前 | 只看该作者
感谢分享启动器,辛苦了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-7-17 21:41

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表