#89611 - 2002-11-22 01:34 AM
Re: help with creating shortcuts with shellLinkObject
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Hmm. This has been a tricky one. I was able to create a shortcut. It creates the shortcut in the same directory as the shortcut target, so it'll have to be renamed/moved/... afterwards.
code:
$objShell = CreateObject("Shell.Application") $objFolderItem = $objShell.NameSpace("C:\Documents and Settings\Chris\Desktop\kixforms.zip").Self $objFolderItem.InvokeVerb("Create &Shortcut")
|
Top
|
|
|
|
#89617 - 2002-11-22 02:29 AM
Re: help with creating shortcuts with shellLinkObject
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Oh, well there is this method as well...
code:
$objShell = CreateObject("Shell.Application") $objFolderItem = $objShell.NameSpace("C:\Documents and Settings\Chris\Desktop\kixforms.zip").Self ;$objFolderItem.InvokeVerb("Create &Shortcut")
$Verbs = $objFolderItem.Verbs For Each $Verb in $Verbs $Verb ? Next
|
Top
|
|
|
|
#89619 - 2002-11-22 02:37 AM
Re: help with creating shortcuts with shellLinkObject
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
I scimmed it , but didn't see you creating the collection. So, I assumed you was pulling the verb from somewhere else. I figured it out, but you had already called me out.
|
Top
|
|
|
|
#89622 - 2002-11-22 08:42 PM
Re: help with creating shortcuts with shellLinkObject
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Sorry, been mucho busy with actual work work today. I guess since they pay my bills, I should pay them a little attention once in a while.
Can you show me all of your code?
|
Top
|
|
|
|
#89624 - 2002-11-22 09:23 PM
Re: help with creating shortcuts with shellLinkObject
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Got it! The $verb is a vartype=9, so the invokeverb command doesn't know what to do with an object. Therefore, try...
code:
$objShell = CreateObject("Shell.Application") $objFolderItem = $objShell.NameSpace("C:\Documents and Settings\ShiltCK\Desktop\carbgramcounter.pdf").Self $Verbs = $objFolderItem.Verbs For Each $Verb in $Verbs if instr($verb,readvalue("HKEY_CLASSES_ROOT\lnkfile","")) $objFolderItem.invokeverb($verb.name) endif Next
get $x
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
1 registered
(Allen)
and 566 anonymous users online.
|
|
|