Create shortcut to file with batch file

July 15, 2010 at 07:48:51
Specs: Windows 7
How can i create a batch file that will create a shortcut to a file and place it on the desktop. i am using windows 7 and xp (please make compatible for both)

See More: Create shortcut to file with batch file

Report •


#1
July 15, 2010 at 08:36:21
<code>
@cd FILEPATH
@start FILENAME.EXE
</code>

example

@cd "C:\Program Files\Mozilla Firefox\"
@start firefox.exe


Report •

#2
July 15, 2010 at 08:40:46
k but how does that create a shortcut ie (.lnk)

Report •

#3
July 15, 2010 at 12:16:40
I'd suggest VBScript, or at least some language capable of using Explorer's COM object model.

Report •

Related Solutions

#4
July 15, 2010 at 17:16:46
i guess you could also just put the batchfile into the desktop directory - it's not a .lnk shortcut though, just a batch that has a clickable icon.

Report •


Ask Question