WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Shortcut Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Create and Edit a shortcut to a BAT file.

Keywords: 	 Create Edit shortcut BAT file ShortcutMake ShortcutExtra

Question:

I am trying to create a shortcut to a .bat file in Windows 95. However it is not creating a .lnk file, instead it creates a .pif file. Why is this and how do I create the shortcut and modify the icon????

Answer:

Yes your correct. In Windows 95 when you create a shortcut to a .BAT file, it actually creates a .PIF file instead of a .LNK file. Try creating the shortcut to the bat file manually, from within Windows 95, you'll see it creates a .PIF file...

You can create the 'shortcut' to the .BAT, then edit the resulting .PIF, using the ShortCutExtra function.

Here is an example how.


dirchange("C:\temp")
ShortcutMake("icon.lnk", "C:\WINDOWS\DESKTOP\WinBatch scripts\doall.bat","", "C:\WINDOWS\DESKTOP\WinBatch scripts\", @icon)
ShortcutExtra("icon.pif", "Test", "^!j", "C:\WINDOWS\GRAYCAT.ICO", 0)
exit
Notice you must reference the .LNK extension when you create the shortcut with ShortCutMake, but once its created you will need to refeernce the .PIF extension, in ShortCutExtra.



Article ID:   W14730
Filename:   Create and Edit a shortcut to a BAT file.txt
File Created: 2001:01:31:10:39:08
Last Updated: 2001:01:31:10:39:08