'Menu to select which folders to rename
Dim Input
Input = InputBox("Who are you?" & vbCrLf & vbCrLf & "Rob" & vbCrLf & "Pat" & vbCrLf & "Other" & vbCrLf & "SAFEMODE")
MsgBox ("Oh, hi there " & Input)
'Rename folder to bin/saves from original
Set WshShell = WScript.CreateObject("Wscript.Shell")
vAPPDATA = WshShell.ExpandEnvironmentStrings("%appdata%")
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder vAPPDATA & "\.minecraft\bin" & Input , vAPPDATA & "\.minecraft\bin"
objFSO.MoveFolder vAPPDATA & "\.minecraft\saves" & Input , vAPPDATA & "\.minecraft\saves"
'Run minecraft, watch for it to close
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """%appdata%\.minecraft\minecraft.exe""", 1, True
Set WshShell = Nothing
Wscript.Sleep 5000
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='javaw.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count 'it can be more than 1
Do While iniproc = 1
wscript.sleep 5000
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='javaw.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Loop
set cproc=nothing
set svc=nothing
'Rename folder to how it started
MsgBox (Input &", you quit!")
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder vAPPDATA & "\.minecraft\bin" , vAPPDATA & "\.minecraft\bin" & Input
objFSO.MoveFolder vAPPDATA & "\.minecraft\saves" , vAPPDATA & "\.minecraft\saves" & Input