¿Crear un icono de programa mediante un archivo .bat?

Post Reply
User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

¿Crear un icono de programa mediante un archivo .bat?

Post by karinha »

¿Crear un icono de programa mediante un archivo .bat? -> WINDOWS 11.

Buenas tardes, ¿cómo creo un acceso directo en el escritorio(Desktop) de Windows utilizando un archivo .bat?

Good afternoon, how do I create a Windows desktop shortcut using a .bat file?

Gracias, tks.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Enrico Maria Giordano
Posts: 9054
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: ¿Crear un icono de programa mediante un archivo .bat?

Post by Enrico Maria Giordano »

Why not using a function instead?

Code: Select all | Expand

FUNCTION CREATELINK( cLnk, cPath )

LOCAL oShell, oLink

LOCAL lOk := .F.

BEGIN SEQUENCE
    oShell = CREATEOBJECT( "WScript.Shell" )

    oLink = oShell:CreateShortCut( cLnk )

    oLink:TargetPath = cPath

    oLink:Save()

    lOk = .T.
END SEQUENCE

RETURN lOk
User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: ¿Crear un icono de programa mediante un archivo .bat?

Post by karinha »

Thanks, Enrico.

What are cLnk and cPath? A quick example, please?

Gracias, tks.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Enrico Maria Giordano
Posts: 9054
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: ¿Crear un icono de programa mediante un archivo .bat?

Post by Enrico Maria Giordano »

cLnk is the path and file name of the LNK file to create and cPath is the path and (optionally) file name target for the LNK file to point to.

Post Reply