Ok - I dropped the idea for a .BAT file and I'm instead using a little update program written in .net
Code:
Imports System.IO
Module APCUpd
Sub Main(ByVal args As String())
Dim s1 As String = args(0).Replace("~", " ")
MsgBox(s1)
File.Move(Path.Combine(s1, "APC1.txt"), Path.Combine(s1, "APC2.txt"))
End Sub
End Module
This is actually stored in a database on a network server and "dropped" onto a pocket PC with this code
Code:
Dim ExeData As Byte() = DirectCast(LDrc.ExecuteScalar, Byte())
Dim fs As New FileStream(Path.Combine(strBaseFolder, "APCUpd.exe"), FileMode.CreateNew)
Using bw As BinaryWriter = New BinaryWriter(fs)
bw.Write(ExeData)
bw.Close()
End Using
And then it's run with this:
Code:
Process.Start(Path.Combine(strBaseFolder, "APCUpd.exe"), strBaseFolder.Replace(" ", "~"))
The reason for the tilde replace is that spaces were causing multiple "arguments" to be passed into the SUB MAIN()
I'm going to use all this for "self-upgrading" programs on PPC when the network database has a new version available.