• Help Support The Rugby Forum :

Reply to thread

The only advantage of a batch file over something coded used vb is if someone didn't have the .net framework installed (but then they couldn't use most the editors anyway).

I used batch files for non-replacing add-ons in BLIC2005 but, as woosaah says, it's dead easy to do in .net.

Here's the code I wrote for the R08 ref kit changer (did I ever release that?) to show you the format: (I know that putting imports system.io at the start would have saved me some typing!)


[code]If IO.File.Exists(strR08path & refkitfront) Then IO.File.Delete(strR08path & refkitfront)

        If IO.File.Exists(strR08path & refkitback) Then IO.File.Delete(strR08path & refkitback)

        If IO.File.Exists(strR08path & refkitfrontWC) Then IO.File.Delete(strR08path & refkitfrontWC)

        If IO.File.Exists(strR08path & refkitbackWC) Then IO.File.Delete(strR08path & refkitbackWC)

        Select Case cboKitType.SelectedIndex

            Case 0 'Play now

                IO.File.Copy(strAppPath & "kits\PlayNow\kit" & kitnumber & ".big", strR08path & refkitfront)

                IO.File.Copy(strAppPath & "kits\PlayNow\kit" & kitnumber & ".fsh", strR08path & refkitback)

            Case 1 'World Cup

                IO.File.Copy(strAppPath & "kits\WorldCup\kit" & kitnumber & ".big", strR08path & refkitfrontWC)

                IO.File.Copy(strAppPath & "kits\WorldCup\kit" & kitnumber & ".fsh", strR08path & refkitbackWC)

            Case 2 'Six Nations

                IO.File.Copy(strAppPath & "kits\SixNations\kit" & kitnumber & ".big", strR08path & refkitfront)

                IO.File.Copy(strAppPath & "kits\SixNations\kit" & kitnumber & ".fsh", strR08path & refkitback)

            Case 3 'Tri Nations

                IO.File.Copy(strAppPath & "kits\TriNations\kit" & kitnumber & ".big", strR08path & refkitfront)

                IO.File.Copy(strAppPath & "kits\TriNations\kit" & kitnumber & ".fsh", strR08path & refkitback)

            Case 4 'Top 14

                IO.File.Copy(strAppPath & "kits\Top14\kit" & kitnumber & ".big", strR08path & refkitfront)

                IO.File.Copy(strAppPath & "kits\Top14\kit" & kitnumber & ".fsh", strR08path & refkitback)

            Case 5 'Guinness Premiership

                IO.File.Copy(strAppPath & "kits\Premiership\kit" & kitnumber & ".big", strR08path & refkitfront)

                IO.File.Copy(strAppPath & "kits\Premiership\kit" & kitnumber & ".fsh", strR08path & refkitback)

            Case 6 'Heineken Cup

                IO.File.Copy(strAppPath & "kits\EuroCup\kit" & kitnumber & ".big", strR08path & refkitfront)

                IO.File.Copy(strAppPath & "kits\EuroCup\kit" & kitnumber & ".fsh", strR08path & refkitback)

        End Select[/code]


673 Words
Top