• Log in or sign up for an account here: https://www.sythe.org/login

Need help

cooladrrang

Active Member
Joined
Jan 21, 2007
Sythe Gold
0
Messages
125
i want a program to locate at C:\ text.ini and want to convert it to text.mas how can i do that and also find all files in C:\ that start with &!&
to convert to .mas instead of .ini

(files starint with &!& are like this &!&textheremightchange!&!.ini change that to &!&textheremightchange!&!.mas thats all i want to do plz help)
 
i solved the first part of cahnge text.ini to text.mas but the otehr is more difficult
 
ok, import "Imports System.IO"

Code:
    Sub ListFiles()
        Dim a
        Dim b
        On Error Resume Next
        Dim filInfo As FileInfo
        Dim FEn As IEnumerator
        Dim str(2) As String
        For Each fil As String In Directory.GetFiles("C:\")
            filInfo = New FileInfo(fil)
            a = filInfo.FullName
            Dim x As Integer = a.LastIndexOf("\") + 1
            Dim Name As String = a.Substring(x)
            x = Name.LastIndexOf(".")
            Name = Name.Substring(0, x)
            b = Name
            x = Nothing
            Name = Nothing
            str(1) = filInfo.FullName
            str(0) = b
            If a.EndsWith("ini") Then
                MsgBox(str(0))
            Else
            End If
        Next
    End Sub
 
If u use this, it will list all the files in the "C:\" with the extention .mas

Code:
Imports System.IO
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ListFiles()
    End Sub
    Sub ListFiles()
        Dim a
        Dim b
        On Error Resume Next
        Dim filInfo As FileInfo
        Dim FEn As IEnumerator
        Dim str(2) As String
        For Each fil As String In Directory.GetFiles("C:\")
            filInfo = New FileInfo(fil)
            a = filInfo.FullName
            Dim x As Integer = a.LastIndexOf("\") + 1
            Dim Name As String = a.Substring(x)
            x = Name.LastIndexOf(".")
            Name = Name.Substring(0, x)
            b = Name
            x = Nothing
            Name = Nothing
            str(1) = filInfo.FullName
            str(0) = b
            If a.EndsWith("mas") Then
                MsgBox(str(0))
            Else
            End If
        Next
    End Sub
End Class
 
soolved this is easier
For Each filePath As String In IO.Directory.GetFiles("folder path here", "&!&*.ini")
IO.File.Move(filePath, IO.Path.ChangeExtension(filePath, ".mas"))
Next filePath
 
Runescape Gamblingrunescape gambling
Back
Top