In VB.NET
I am trying to read in application paths from a text file and then execute the application with the Process control, to avoid editing and re-compilation for different machines.
The path reads like "%windir%","\system32\calc.exe" OR "My.Computer.FileSystem.SpecialDirectories.Program Files, "\Calc98\CALC.EXE"
I am splitting the string into an array, using the comma as the separator, and am trying to use the elements to set the Process filename: -
with Process1
.Filename=string.concat(array(0), array(1))
.Start()
end with
If I type in string.concat(My.Computer.FileSystem.SpecialDirect ories.ProgramFiles,array(1)) the first parameter is converted into c:\ProgramFiles, but isn't converted when read in from array(0).
The VB.NET compiler objects to %windir% however I enter it, although it is accepted in the StartInfo.Filename property at Design Time.
I've tried all ways to remove the quotation marks and tried converting the trimmed name to an object but without success.
Has anyone managed to vercome this sort of problem, please?
I'm tearing my hair out and have hit a brick wall.
Michael.