I am trying to get my program to write a .bat file to run, it writes the file fine but the file wont run properly as it needs to be encoded with ANSI but i don't know how to set it to write that. Can someone help please?
The code for this part so far:
Private Sub start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles start.Click
If My.Computer.FileSystem.FileExists(".\run\run.bat") Then
My.Computer.FileSystem.DeleteFile(".\run\run.bat")
End If
Dim map As String
Dim crrtdir As String
crrtdir = My.Computer.FileSystem.CurrentDirectory
map = List1.SelectedItem
My.Computer.FileSystem.CreateDirectory(".\run")
My.Computer.FileSystem.WriteAllText(".\run\run.bat", crrtdir & "\srcds.exe -console -game " & game & " +map " & map, False)
System.Diagnostics.Process.Start(crrtdir & "\run\run.bat")
End Sub
Thank's