Johannes Charra
Johannes Charra

Reputation: 29933

Shortcut to a batch file

This is a little pathetic :) but I cannot figure it out:

I want to create a windows batch file that calls another one without opening a new console window. It's used to fire up the glassfish, but that's secondary.

My batch file "start.bat" reads

@echo off
cd bin
call "asadmin.bat start-domain domain1"
pause

And I want to call it from the windows console. Unfortunately it only opens up a new console window without doing anything.

Upvotes: 0

Views: 542

Answers (2)

Maarten
Maarten

Reputation: 492

Give this a try:

@ ECHO OFF
cd bin
COMMAND /C asadmin.bat start-domain domain1

note that using this command starts up a new environment which inherits any variables from the calling batch file.

Upvotes: 0

Cédric Julien
Cédric Julien

Reputation: 80801

try with

@echo off
cd bin
call asadmin.bat start-domain domain1
pause

the "" can lead batch to seek for the batch file "asadmin.bat start-domain domain1"

Upvotes: 1

Related Questions