V
V
ViceInc2021-09-21 15:04:43
Command line
ViceInc, 2021-09-21 15:04:43

How to run a program using a bat file specifying the working directory?

I create such batch file

File.WriteAllText("AVUC.bat", "@echo off\n" + 
                        "cd \"" + dirPath + "\"\n" +
                        "start AVUC.exe\n" +
                        "exit");


But the application (in C# if anything) cannot find the text file in its folder. I think the working directory is not correct. (The batch file is in autoload). How to write a command correctly so that the working directory is the folder in which the exe is located?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question