回答編集履歴

1

WorkingDirectory について追記

2023/03/03 02:58

投稿

KOZ6.0
KOZ6.0

スコア2628

test CHANGED
@@ -1,4 +1,4 @@
1
- ProcessStartInfo を使って起動しては?
1
+ ProcessStartInfo を使い、WorkingDirectory を指定し起動しては?
2
2
 
3
3
  ```vb
4
4
  Imports System.IO
@@ -11,10 +11,11 @@
11
11
  Dim info As New ProcessStartInfo With {
12
12
  .FileName = Path.Combine(batPath, "..\A.bat"),
13
13
  .WorkingDirectory = Path.Combine(batPath, "..\"),
14
- .RedirectStandardOutput = True,
15
14
  .UseShellExecute = False
16
15
  }
17
- Process.Start(info)
16
+ Using p = Process.Start(info)
17
+ p.WaitForExit()
18
+ End Using
18
19
  Console.ReadKey()
19
20
  End Sub
20
21