0

I am creating a script and I need to run exe file and a command at the same time. What am I doing wrong?

CD C:\Program Files (x86)\Jenkins\
START cmd.exe /T /C "jenkins.exe start"

The command line needs to be exactly as the following, otherwise it does not work: C:\Program Files (x86)\Jenkins>jenkins.exe start

Thanks!

gopp
  • 23
  • 6
  • It appears that `jenkins.exe` is the "exe file" you want to run. What is the "command" you want to run at the same time? – lit Sep 26 '18 at 14:41
  • It is the start command. – gopp Sep 26 '18 at 16:28
  • 1
    I do not know, but it appears that "start" may be a parameter to the executable "jenkins.exe" and not a separate command. See the answer at https://stackoverflow.com/questions/14869311/start-stop-and-restart-jenkins-service-on-windows – lit Sep 26 '18 at 17:08

1 Answers1

0

I don't quiet understand what you mean by saying you wan't to run an exe and a command at the same time. But if you wan't to start the jenkins.exe from your batch file, you can achieve this as follows:

cd "C:\Program Files (x86)\Jenkins\"
jenkins.exe start

alternatively, if you don't want the terminal to stay open as long as jenkins is running, you can use the following:

cd "C:\Program Files (x86)\Jenkins\"
start jenkins.exe start
Fitzuntis
  • 16
  • 1
  • 1
    You would not even need the `CD` command either. You can use the full path of the executable to start the program. You could also use the `/D` option of the `START` command to set the working directory to the folder location of `Jenkins`. – Squashman Sep 26 '18 at 14:08