[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

3/12/2012 9:18:00 PM

My little VB6 app is trying to work with shortcuts.
The note I have accumulated do not seem to jibe with what Googles out.

Rule 1. Put Drive:\Path Name\Filename in double quotes (has spaces).

Rule 2. Use a ? to separate arguments (cannot find help on this)

Rule 3. Environment variables go in % e.g. %userprofile&

Rule 4. Do not put arguments without spaces in double quotes.

But I also see that a space is used instead of a '?'.

So what are all the rules and when does '?' come into play?


29 Answers

Tony Toews

3/12/2012 10:03:00 PM

0

On Mon, 12 Mar 2012 13:17:41 -0800, BeeJ <nospam@spamnot.com> wrote:

>Rule 1. Put Drive:\Path Name\Filename in double quotes (has spaces).

Agreed.

>Rule 2. Use a ? to separate arguments (cannot find help on this)

Never heard of this.

>Rule 3. Environment variables go in % e.g. %userprofile&

They can if you want to but you can use the complete path if desired.

Indeed if you put a path in the target, if appropriate, Windows
happily replaces the path text with %appdata%. That is Windows
changes
C:\Users\ttoews\AppData\Roaming\A2007 locking file FE
to
%appdata%\A2007 locking file FE. If memory serves me properly.

>Rule 4. Do not put arguments without spaces in double quotes.

I don't think that matters but it might. Now that I think about it
Windows might remove the double quotes if not needed.

Here is a sample shortcut target created in VB6.

Q:\1_vb\StartMDB\StartMDB.exe /cmd /inifile:"Q:\1_vb\StartMDB\_
files\Test Server shortcut icon.ini"

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/ac...
Tony's Microsoft Access Blog - http://msmvps.com/blo...
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeup...

Tony Toews

3/12/2012 10:04:00 PM

0

On Mon, 12 Mar 2012 13:17:41 -0800, BeeJ <nospam@spamnot.com> wrote:

>My little VB6 app is trying to work with shortcuts.

BTW you are using the SHELLLNK.TLB, right?

Try it and see what happens.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/ac...
Tony's Microsoft Access Blog - http://msmvps.com/blo...
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeup...

BeeJ

3/12/2012 10:13:00 PM

0

Forget about the '?'. I figured out that was bogus.

I am using Shell32.dll.

If shlShell Is Nothing Then
Set shlShell = New shell32.Shell

End If
shlShell.Open sPath
DoEvents

Where sPath has the whole 'Target' line.

Is SHELLLNK.TLB a better way to go?
What is it in References?


Tony Toews

3/12/2012 10:22:00 PM

0

On Mon, 12 Mar 2012 14:12:44 -0800, BeeJ <nospam@spamnot.com> wrote:

>I am using Shell32.dll.

Never used it so no comment.

> If shlShell Is Nothing Then
> Set shlShell = New shell32.Shell
>
> End If
> shlShell.Open sPath
> DoEvents
>
>Where sPath has the whole 'Target' line.
>
>Is SHELLLNK.TLB a better way to go?

I'm not sure if it's better or not. It's code I came across about a
decade ago. But if your solution is working then I'd stay with it.

>What is it in References?

It's a type library which just describes an interface to other
"stuff". So it's included as a reference but the TLB file is not
distributed along with your VB6 exe.

Tony

--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/ac...
Tony's Microsoft Access Blog - http://msmvps.com/blo...
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeup...

unknown

3/12/2012 10:23:00 PM

0

BeeJ wrote:
> My little VB6 app is trying to work with shortcuts.
> The note I have accumulated do not seem to jibe with what Googles out.
>
> Rule 1. Put Drive:\Path Name\Filename in double quotes (has spaces).

Nah, add double quotes anyway. It's perfectly valid to add double quotes
around paths that don't contain spaces.

> Rule 2. Use a ? to separate arguments (cannot find help on this)

Must be something used as parameter substitute, like "Notepad ?", then
replace the "?" with a file name before handing it over to Shell function or
something. It has nothing to do with what Windows or the Shell requires.

> Rule 3. Environment variables go in % e.g. %userprofile&

Only if you prefer it that way.

> Rule 4. Do not put arguments without spaces in double quotes.

See my comments for #1 above. That way you don't have to worry whether there
is a space in the path or not. It's up to the application to interpret the
parameters. Many that expect a path as a parameter to be surrounded by
double quotes if it contains spaces. But this is not a rule. It depends on
the application.


BeeJ

3/12/2012 10:29:00 PM

0

I found

VB 5 - IShellLinkA Interface(ANSI)
shelllnk.tlb

I used this in another project but totally forgot about it.

But the question remains ... where can I find all the options.

I tried Google again, this time through VBAccelerator but Google has
cut that method off (as a link in a webpage allowing Google from
there).

GoOgle - just realized that Google is Go Ogle. (I'm slow)


unknown

3/12/2012 10:42:00 PM

0

BeeJ wrote:
> I found
>
> VB 5 - IShellLinkA Interface(ANSI)
> shelllnk.tlb
>
> I used this in another project but totally forgot about it.
>
> But the question remains ... where can I find all the options.
>
> I tried Google again, this time through VBAccelerator but Google has
> cut that method off (as a link in a webpage allowing Google from
> there).

See "IShellLink" in MSDN.


Karl E. Peterson

3/12/2012 10:49:00 PM

0

After serious thinking BeeJ wrote :
> Rule 2. Use a ? to separate arguments (cannot find help on this)

First thought was bogus Unicode-ANSI translation.

--
..NET: It's About Trust!
http://vfre...


BeeJ

3/12/2012 10:55:00 PM

0

After Finding Shellnk.tlb I found the old app and F2ed IShellLinkA.

Lotsa stuff.

Where did that .tlb come from? VBAccelerator? Can't search
VBAccelerator within VBAccelerator due to Google-ations.


ralph

3/12/2012 10:56:00 PM

0

On Mon, 12 Mar 2012 15:48:38 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:

>After serious thinking BeeJ wrote :
>> Rule 2. Use a ? to separate arguments (cannot find help on this)
>
>First thought was bogus Unicode-ANSI translation.

Ha. Second was some kind of URI usage.

-ralph