How to create windows shortcut using Ant? Cómo crear ventanas atajo utilizando Ant?
Why do you need to create a shortcut using Ant? ¿Por qué necesitan para crear un acceso directo utilizando Ant? When do you need to create that ? ¿Cuándo se necesita para crear eso? These might the questions that you will be thinking at this moment when you had a look into this topic. Estos podrían las preguntas que se le pensando en este momento cuando usted tenía una mirada en este tema. Yep I am here to answer these questions. Sí estoy aquí para responder a estas preguntas. I just made this topic just to create a buzz thats it but actually you can make Ant to execute any operating system specific commands through your build. Me acaba de hacer este tema sólo para crear un rumor, pero esa es en realidad puede hacer Ant para ejecutar cualquier sistema operativo específico comandos a través de su construcción. It may be shortcut, or if you want to execute any operating system specific command you can make use of this tutorial. Puede ser en breve, o si se desea ejecutar cualquier sistema operativo comando específico puede hacer uso de este tutorial. Ant currently supports widely used and famous operating systems like Windows, Apple, Linux, Solaris, AIX etc. You can get the list of supporting operating system from sun specification. Ant actualmente apoya ampliamente utilizado y famosos sistemas operativos como Windows, Apple, Linux, Solaris, AIX, etc Usted puede obtener la lista de sistema operativo compatible de sol pliego de condiciones. You can get your current operating system by executing the following line of code in your java program Usted puede conseguir su actual sistema operativo de la ejecución de la siguiente línea de código en su programa java
System.getProperty( "os.name" ); System.getProperty ( "os.name"); When do you need to use this? ¿Cuándo se necesita para utilizar este? This may not be useful for web application developers but they can also use this while building their enterprise or web application to automate few things. Esto puede no ser útil para los desarrolladores de aplicaciones web, pero también pueden utilizar este, mientras que la construcción de su empresa o aplicación web para automatizar algunas cosas. But desktop application developers who may use Swing sets etc may find this tip very useful. Pero los desarrolladores de aplicaciones de escritorio que puede usar Swing, etc puede encontrar este consejo muy útil. You can achieve this by using Exec Task in Ant which is the counter part of Runtime.exec in java. Puede lograr esto usando Exec tarea en Ant, que es la parte contraria de Runtime.exec en java. Here I am not going to explain you about How to run or create Ant Build. Aquí no voy a explicar usted acerca de cómo ejecutar o crear Ant Build. It does not fall under this scope of short tutorial. No entran en este ámbito de corto tutorial.
Here we go, before getting into the tutorial we will see how to execute a windows command to get the environmental variable path Aquí vamos, antes de entrar en el tutorial veremos cómo se ejecuta una ventana de comando para obtener la variable ambiental camino
cmd is the command prompt for windows higher than win 98 and ‘/c’ is mandatory to execute the command in the command shell. cmd es la línea de comandos para las ventanas superior a 98 y ganar '/ c' es obligatorio para ejecutar el comando en el shell de comandos. To know more about Exec task kindly refer Para saber más sobre cometido Exec amablemente se refieren here aquí . Now coming to the point, to create a shortcut unless you don’t have any Windows Resource Kits or read made utilities you have to use VB Script to create shortcuts. Ahora viene hasta el punto, para crear un acceso directo a menos que usted no tiene ninguna Windows kits de recursos o utilidades realizados leer lo que tienes que utilizar VB Script para crear accesos directos. The script will be making use of WScript. El script se haga uso de WScript. Shell of windows to do the job. Shell de ventanas para realizar el trabajo. Kindly follow the code snippet given below which creates a shortcut file for a java archive file, Por favor, siga el fragmento de código dado por debajo de la cual crea un acceso directo para un archivo de java archivo,
Save the above code as shortcut.vbs. Guardar el código anterior como shortcut.vbs. Pls find the corresponding code snippet for part of the ANT Build that uses exec task Pls encontrar el fragmento de código correspondiente para una parte de la ANT Build que utiliza exec tarea





























