VB.NETでアプリケーションを開発した...
Dim DIAGTOOL_loc As String = Environment.CurrentDirectory & "\folder\file.exe"
Dim shellexec As New System.Text.StringBuilder
shellexec.AppendLine("@echo off")
shellexec.AppendLine("cls()")
shellexec.AppendLine(": begin()")
shellexec.AppendLine("cls()")
shellexec.AppendLine("START " & DIAGTOOL_loc.ToString)
shellexec.AppendLine("pause")
IO.File.WriteAllText("tester.bat", shellexec.ToString())
System.Diagnostics.Process.Start("tester.bat")
コマンド プロンプトが開くと、file.exe (DIAGTOOL_loc) が実行されますが、CMD が読み込まれると、「Windows は "C:\Users\ ..." を見つけることができません」と表示されます。
しかし、なぜ?どうしたの?DIAGTOOL_loc 変数に登録されているパスは、Process.start(DIAGTOOL_loc) と入力すると機能するため、ファイルが存在します...なぜ cmd で見つからないのですか?
このコマンド:
shellexec.AppendLine("START " & DIAGTOOL_loc.ToString)
file.exeを開く必要があります...しかし、機能しません...