open and pass multiple commands to other shell
Posted: 18 Apr 2022 00:40
Assume I want to setup several environment variables and start a program from a certain directory.
In a DOS batch file I can (simplyfied) code therefore:
When I double click on such a batch script then the program is successfully started.
But unfortunately the command prompt remains open even after program start.
I want to avoid having an opened Command Prompt window.
Is there a smart way to close the current Command prompt window (not: process) without killing the started window?
I guess not. So i had to go the hard way:
Therefore I have to open a second shell and pass multiple programs. The following does NOT work:
Whats wrong?
In a DOS batch file I can (simplyfied) code therefore:
Code: Select all
set path_to_java64=D:\java\bin
set path_to_settings=D:\db\tools\DBeaver\mysettingsfolder
set PATH=%path_to_java64%;%PATH%
dbeaver.exe -data "%path_to_settings%"
But unfortunately the command prompt remains open even after program start.
I want to avoid having an opened Command Prompt window.
Is there a smart way to close the current Command prompt window (not: process) without killing the started window?
I guess not. So i had to go the hard way:
Therefore I have to open a second shell and pass multiple programs. The following does NOT work:
Code: Select all
set path_to_java64=D:\java\bin
set currpath=cd
set path_to_settings=D:\db\tools\DBeaver\mysettingsfolder
start "DBeaver64.bat" /B (set PATH=%path_to_java64%;%PATH% & cd /d "%currpath%" & dbeaver.exe -data "%path_to_settings%")