Skip to content

Instantly share code, notes, and snippets.

@Rudokhvist
Created April 3, 2018 16:07
Show Gist options
  • Save Rudokhvist/3e4fd2004198dc79085f12c0a999143d to your computer and use it in GitHub Desktop.
Save Rudokhvist/3e4fd2004198dc79085f12c0a999143d to your computer and use it in GitHub Desktop.
Rename .maFiles to steam login names instead of SteamID.
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