FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour ¿Crear un icono de programa mediante un archivo .bat?
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

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

Posted: Wed Aug 19, 2026 04:25 PM

¿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
Posts: 9052
Joined: Thu Oct 06, 2005 08:17 PM

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

Posted: Wed Aug 19, 2026 05:17 PM

Why not using a function instead?

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
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

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

Posted: Wed Aug 19, 2026 06:15 PM

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
Posts: 9052
Joined: Thu Oct 06, 2005 08:17 PM

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

Posted: Wed Aug 19, 2026 06:25 PM

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.

Continue the discussion