Command not working in .bat file

jsfgeeks - Dec 2, 2008 at 06:04 AM
 kiraks2009 - Sep 26, 2016 at 05:44 AM

I am developing a JSF application. I need to make batch file for that. So that when the user clicks on it, it automatically starts the glassfish server, deploys the war file and starts the browser with the project window.

I can do this in cmd prompt like below;

Step-1 : cd Goto bin directory of glassfish
Step-2 : asadmin start-domain domain1
Step-3 : asadmin deploy --user admin path-of-war-file.war
Step-4 : @start "" /b "iexplore.exe" http://localhost:8080/projectname/

I can achieve that from cmd prompt, but when I tied it in batch file then after starting the server, it quits the batch file and not executing the commands for deploying and starting browser.

Can anyone help me out ???

Thanks in advance,

2 replies

If asadmin is a name of application you run then try step2 a d 3 to be:
start /W asadmin start-domain domain1
start /W asadmin deploy --user admin path-of-war-file.war

/W switch of windows' Start.exe makes script wait for completition of command.
It works... THANKS....
Thanks dude...was in the same fix and now it works as a charm.