I'm trying to turn a .lnk file and its arguments into a programmatically executed process using ProcessStartInfo.
The .lnk file looks like this:
Target:
E:\Apps\RunAsDate\RunAsDate.exe 30\10\2017 00:00:00 "D:\MyTest\test.exe"
Execute in:
"D:\MyTest"
I have a function in test.exe that displays the datetime so that I can check if it worked. For the .lnk file, it works perfectly.
I tried the following:
Dim nProc As New ProcessStartInfo
nProc.FileName = "E:\Apps\RunAsDate\RunAsDate.exe"
nProc.Arguments = "30\10\2017 00:00:00 ""D:\MyTest\test.exe"""
nProc.WorkingDirectory = "D:\MyTest"
nProc.UseShellExecute = True
Process.Start(nProc)
The file "D:\MyTest\test.exe" is being started, but the date arguments are lost, so I must be doing something wrong when passing the arguments.
What is the error here?
I'm running this as an admin.