WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Forum

  Reply to this topicStart new topicStart Poll

Windows Shortcut Files, PIF LNK Shortcut Files Shortcuts Shell COM

SeaFarer
Posted: Sep 7 2007, 08:08 PM
Quote Post


GO NAVY!
******

Group: Admins
Posts: 744
Member No.: 1464
Joined: 2-September 05



Hi,

I did a search for this topic but did not find anything here at winasm.org, and very little elsewhere.

The MASM32 package includes an example in COM for creating shortucts, primarily focused on .EXE files.

When using an .EXE file, the shortcut is created as .LNK file. When using .BAT or .COM files, the example will create .PIF shortcuts.

Now... with a slight modification you can update this example to also include a "Set Working Directory Method," in addition to the two other methods already in the example.

The real problem rests in getting the example to properly include, say.... the MS-DOS icon for .BAT and .COM file shortcuts, like the windows shell does when manually creating shortcuts.

The Question

Making shortcuts is a breeze for .EXE files, but...

How do you create shortcuts that properly include the MS-DOS icon, or the icon of your choice for .BAT and .COM files, when using Mr. Murphy's adopted COM shortcut example incuded in MASM32? Or is there a better way?

I have attached the slightly modified version that includes "Set Working Directory Method."

Please note that I have set my studio pathing options to include the MASM32 Include directory so that I do not have to have explicit path names, so you may have to...

1.) Add the full Paths back to the example.

or...

2.) Update your studio path settings.

I look forward to some dialouge on this topic.

Thank you for participation at winasm.org ;)

SEE ALSO: \MASM32\COM\EXAMPLES\SHORTCUT

Attached File ( Number of downloads: 2 )
Attached File  Login/Register to be able to download

PMUsers Website
Top
SeaFarer
Posted: Sep 7 2007, 10:54 PM
Quote Post


GO NAVY!
******

Group: Admins
Posts: 744
Member No.: 1464
Joined: 2-September 05



Some interesting results during tests with Mr. Murphy's example....

1.) If there are any spaces in the PATH Object/FILE specification...

Then and only then, will the Target and Working directory strings be quoted(bracketed) as Mr. Murphy points out.

2.) If an .EXE file is specified with COMMANDLINE arguments...

The .EXE icon will not be extracted and added to the shortcut, plus...

If a "/" precedes a commandline argument, it is replaced with "\"

Mr. Murphy did mention the example is just a "Quick Hack," but come on! Nothing better than this in 5 or 6 years? Surely there is a "correct way" to handle shorcuts for LNK and PIF formats, and still be able to have a commandline and icon. :(

As a relevant, but somewhat unrelated question...

How current is the MASM32 project? I mean, is it still being updated, or is it in limbo?

I ask since MS no longer supports Win98, and they have pulled all links for the W98DDK.EXE package, which spawned the project according to what I had read.(probably due to abuse of the EULA more than anything else, as well as guaranteed $$$ for future 64-bit tools)

Plus things are moving towards Vistas...

Vista n. 1.a. A distant view or prospect, especially one seen through an opening, as between rows of buildings or trees. b. An avenue or other passage affording such a view. 2. An awareness of a range of time, events, or subjects; a broad mental view. [Italian, from feminine past participle of vedere, to see, from Latin vid�re.] See also Spyware. ;)
PMUsers Website
Top
japheth
Posted: Sep 8 2007, 05:44 AM
Quote Post


New Member
*

Group: Moderators
Posts: 12
Member No.: 4595
Joined: 15-March 07



QUOTE (SeaFarer @ Sep 7 2007, 10:54 PM)
Mr. Murphy did mention the example is just a "Quick Hack," but come on! Nothing better than this in 5 or 6 years? Surely there is a "correct way" to handle shorcuts for LNK and PIF formats, and still be able to have a commandline and icon.� :(


Hi,

I don't know if it is "better" (it surely is no "sample"), but in the

ExplASM

application there is a shortcut created (file CDropTarget.asm, proc "CreateLink").

IMO, the IShellLink interface should provide all methods you need.
PMEmail Poster
Top
SeaFarer
Posted: Sep 8 2007, 07:06 AM
Quote Post


GO NAVY!
******

Group: Admins
Posts: 744
Member No.: 1464
Joined: 2-September 05



Thank you very much japheth.

Here's something else related to my project involving shortcuts and items in the Users Startup folder....

The system I am running only has two .COM files, like most users, that are always used. COMMAND.COM & WIN.COM.

Aside from these, for Win98, there are the MS-DOS .COM files located in the COMMAND directory. Plus... after scanning the hard disk, I noticed that WinZip has WZ.COM.(Although I have never used it.)

Everything else is .EXE, aside from some batch files.

Since everyone runs thier computers differently....

I guess after analizing for these file types, I am wondering how often the need to EXEC a .COM or .BAT file from the User Startup Folder might arise.

I personally have never had to have a .COM or .BAT file run at Windows Startup, and do not recall any programs that do or have.(however MS-OFFICE find files fast driver comes to mind, although I do not use it.)
PMUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll