Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Shortcut with Batch File

Status
Not open for further replies.

gdkz

Programmer
Nov 21, 2002
44
0
0
US
I am trying to create a short cut to a batch file from within a batch file. I have experimented with the following code, but been unable to link to the batch file.
Code:
del "c:\link.url"
echo [DEFAULT] >> "c:\link.url"
echo BASEURL= >> "c:\link.url"
echo [InternetShortcut] >> "c:\link.url"
echo URL="c:\link.url" >> "c:\link.url"
::alternatively have tried
::echo URL="file:///c:\ON.bat"
echo IconIndex=109 >> "c:\link.url"
echo IconFile=c:\WINDOWS\system32\SHELL32.dll >> "c:\link.url"

Where link.url is the shortcut and ON.bat is the batch file I need the shortcut to link to. What am I doing wrong. I have seen some ways to accomplish this with a WSC, but was told I could do it with a batch file. Any help is appreciated.


Thanks,
Greg
 
The url format is for InternetShortCut and not for local/network link for .bat which is of extension .lnk. Are you sure you get this basic right? I think not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top