All pastes #2001146 Raw Edit

Settlers 2 to Widelands maps imp

public text v1 · immutable
#2001146 ·published 2010-11-24 17:54 UTC
rendered paste body
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists("D:\progra~1\widelands\maps") Then
    Set objFolder = objFSO.GetFolder("D:\progra~1\widelands\maps")
    Else
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFolder = objFSO.CreateFolder("D:\progra~1\widelands\maps")
        End If


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colFiles = objWMIService. _
        ExecQuery("Select * from CIM_DataFile where Extension = 'wld'")
        For Each objFile in colFiles
            strCopy = "D:\progra~1\widelands\maps\" & objFile.FileName _
                    & "." & objFile.Extension
                        objFile.Copy(strCopy)
                            Next