permaculture playing cards*
The moose likes Ant, Maven and Other Build Tools and the fly likes .bat file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark ".bat file" Watch ".bat file" New topic
Author

.bat file

Jacob Sonia
Ranch Hand

Joined: Jun 28, 2009
Posts: 174
Hi everyone,

For ant build i always need to type many things on the command prompt
and i thought to make a shortcut of it. I created a bat file though, but i still have to browse till the bat file to do everything, so can anyone help me to avoid this with a shortcut.

This is what i want to do from any location
cd\
c:
cd STARTEAM_WORK
cd ant
cd projects
cd ear


so i need a shortcut that i type this from anywhere and i would be able to reach till c:\STARTEAM_WORK\ant\projects\ear
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why not put the directory containing the batch file on your path?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Let me see if I understand this correctly. Your build.xml file is located at c:\STARTEAM_WORK\ant\projects\ear? And you have to constantly cd to the directory before you can run the build script? Why not just open the command prompt in the correct folder? There is a handy Explorer plugin at http://www.gabrieleponti.com/. Once installed, there is an Open Command Prompt Here option added to the context menu for folders in Explorer. I usually browse to the folder I want, and then open the command prompt there using this plugin. I have used this plugin with XP, Vista, Windows 7, Server 2003 and Server 2008.

By the way, Vista has such an option built in but you have to press the Shift key while right-clicking the folder.


JBoss In Action
Jacob Sonia
Ranch Hand

Joined: Jun 28, 2009
Posts: 174
But you still need to browse to that folder..is there anything that i directly type in my command prompt from any location and it takes me to the location coded in the command
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Put the batch file directory on your path! I don't understand what the problem is.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: .bat file
 
Similar Threads
Annoying DOS window
ANT installation problem......
To create a desktop short cut icon for the standalone application
run bat file within java
executing a .bat file through ANT