Dim batfilenamepath As String = ProjectPath & "mydll\\MxDraw52\\"
Dim qdq As String = batfilenamepath.SubString(0,batfilenamepath.IndexOf("\\")) \'bat文件所在目录的驱动器号
Dim path As String = batfilenamepath.SubString(batfilenamepath.IndexOf("\\")+1,batfilenamepath.lastIndexOf("\\")-batfilenamepath.IndexOf("\\")-1)
Dim dirstr As String = "cd\\" & vbcrlf & qdq & vbcrlf & "cd " & path & vbcrlf
Dim p As String = "if /i " & """" & "%PROCESSOR_IDENTIFIER:~0,3%" & """" & " == " & """" & "X86" & """" & " goto X32" & vbcrlf & "MxDrawX52x64.msi" & vbcrlf & "exit" & vbcrlf & ":X32" & vbcrlf & "MxDrawX52.msi" & vbcrlf & "exit"
Dim bat As String = ""
bat &= dirstr
bat &= p \'& """"
FileSys.WriteAllText(batfilenamepath & "MxCAD.bat",bat,False,Encoding.Default)
Dim Proc As New Process
Proc.File = batfilenamepath & "MxCAD.bat"
proc.WaitForClose = True
Proc.Start()