It looks like your MainForm.exe is looking for files in the working directory. Since it has been called from outside the directory where the MainForm.exe
binary is lcoated, it won't be able to find what it's looking for.
This is probably something that needs to be fixed in the MainForm application code. It's probably trying to open a file using a relative path and expecting it to be relative from the directory containing teh binary, but it's now actually looking relative to the working directory.
You can work around this by setting the CurrentDirectory
property of the Shell object:
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.currentdirectory = "G:\ROOT\KnowledgeBaseProdukcija\Deploy\"
shell.Run("""G:\ROOT\KnowledgeBaseProdukcija\Deploy\MainForm.exe""")
Inside the MainForm.exe
s sources use string thatpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
to find the installation path and use Path.Combine(thatpath, "./relative/path/to/resource")
to load any files that you expect to be in a path relative to the executable to fix the issue at the source.