Created
April 3, 2018 16:07
-
-
Save Rudokhvist/3e4fd2004198dc79085f12c0a999143d to your computer and use it in GitHub Desktop.
Rename .maFiles to steam login names instead of SteamID.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set objFileSystem = CreateObject( "Scripting.FileSystemObject" ) | |
Set objCurFolder = objFileSystem.getFolder( "." ) | |
Set ArrayMaFiles = objCurFolder.Files | |
Set RegExp = CreateObject("VBScript.RegExp") | |
RegExp.Pattern = """account_name"":""([^\""]+)\""" | |
RegExp.Global = True | |
For Each objCurMaFile in ArrayMaFiles | |
If LCase(objFileSystem.GetExtensionName(objCurMaFile.Name)) = "mafile" Then | |
Set objMaFile = objFileSystem.OpenTextFile(objCurMaFile.Name,1) | |
strLine = objMaFile.ReadAll() | |
Set Matches = RegExp.Execute(strLine) | |
filename = Matches.Item(0).SubMatches(0) & ".maFile" | |
objMaFile.Close | |
Set objMaFile = Nothing | |
objFileSystem.MoveFile objCurMaFile.Name, filename | |
End If | |
next | |
MsgBox ("done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment