#119129 - 2004-05-06 03:53 PM
Problem creating a specific type of shortcut
|
GSUK
Starting to like KiXtart
Registered: 2004-03-10
Posts: 125
|
Hi there,
Now this sounds really easy but it has got me completely stuck! I am trying to create a shortcut from a mapped share to "c:\documnets and settings\All Users\Start Menu" The problem is if you create the shortcut and then copy the .lnk file to the target, when you click on the icon in the start menu it opens the target folder on your desktop.
Now try this: Open explorer and drag the folder you wish to access over to your start button. Now when you access this icon from your start menu it does not open a folder on your desktop; it expands within the start menu. And this is what I am trying to achieve via a script! I just cannot get it to work!
Please help!
Cheers, Glenn
|
|
Top
|
|
|
|
#119131 - 2004-05-06 04:56 PM
Re: Problem creating a specific type of shortcut
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I remember this trick.. It takes your "My Computer" and creates a ToolBar.
Kent
|
|
Top
|
|
|
|
#119132 - 2004-05-06 05:14 PM
Re: Problem creating a specific type of shortcut
|
GSUK
Starting to like KiXtart
Registered: 2004-03-10
Posts: 125
|
The problem with copying the entire structure is that any changes made on the server could not be replicated down to the users menu bar until the next login. With the shortcut I am trying to create, the changes are instantaneous for everyone. Kent, can you please explain what you mean by “It takes your ‘My Computer’ and creates a ToolBar” Sorry if I’m being a bit thick here…. 
|
|
Top
|
|
|
|
#119133 - 2004-05-06 05:17 PM
Re: Problem creating a specific type of shortcut
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Glenn,
Sorry about that..
I think this is what you are looking for -
http://www.winguides.com/registry/display.php/512/
Kent
|
|
Top
|
|
|
|
#119134 - 2004-05-06 06:01 PM
Re: Problem creating a specific type of shortcut
|
GSUK
Starting to like KiXtart
Registered: 2004-03-10
Posts: 125
|
Agh! That's so close to what I need. Unfortunately I need to be able to cascade from either the START menu or the PROGRAMS menu and there is no key for these! I tried creating a CascadePrograms value on the off chance but it made no difference.
|
|
Top
|
|
|
|
#119136 - 2004-05-07 11:26 AM
Re: Problem creating a specific type of shortcut
|
GSUK
Starting to like KiXtart
Registered: 2004-03-10
Posts: 125
|
Nope! Sorry guys but I still cannot get this to work! I have tried exactly what you suggested Lonkero but now what happens is the directory expands within the start menu but it only displays a folder within it called Target. Clicking on this then opens up the target folder in explorer.
|
|
Top
|
|
|
|
#119137 - 2004-05-07 12:32 PM
Re: Problem creating a specific type of shortcut
|
MightyR1
MM club member
   
Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
|
Quick and dirty:
Code:
Break on ;Define $folder='C:\Documents and Settings\'+@USERID+'\Start Menu\Yada' $lnk=$folder+'\target.lnk' $ini=$folder+'\desktop.ini' ;Create folder MD $folder ;Create target shortcut $rc=wshshortcut($folder+'\target.lnk','p:\temp') ;Create desktop.ini $rc=WriteProfileString($ini,'.ShellClassInfo','CLSID2','{0AFACED1-E828-11D1-9187-B532F1E9575D}') $rc=WriteProfileString($ini,'.ShellClassInfo','Flags','2') $rc=WriteProfileString($ini,'.ShellClassInfo','ConfirmFileOp','0') ;Folder readonly $rc=SetFileAttr($folder,1) ;Ini hidden+system $rc=SetFileAttr($ini,2+4) Exit Function WshShortCut($path,$targetpath,optional $arguments,optional $startdir,optional $iconpath,optional $style) Dim $Shell,$shortcut $Shell=CreateObject("wscript.shell") If $Shell $shortcut=$Shell.createshortcut($path) If $shortcut $shortcut.targetpath=$targetpath If $arguments $shortcut.arguments=$arguments EndIf If $startdir $shortcut.workingdirectory=$startdir EndIf If $iconpath $shortcut.iconlocation=$iconpath EndIf If $style $shortcut.windowstyle=$style EndIf $shortcut.save $shortcut=0 EndIf $Shell=0 EndIf Exit @error EndFunction
Note: The UDF came from the UDF section on this BB.
_________________________
Greetz, Patrick Rutten
- We'll either find a way or make one... - Knowledge is power; knowing how to find it is more powerful... - Problems don't exist; they are challenges...
|
|
Top
|
|
|
|
#119138 - 2004-05-07 02:56 PM
Re: Problem creating a specific type of shortcut
|
GSUK
Starting to like KiXtart
Registered: 2004-03-10
Posts: 125
|
Thanks MightyR1!!! That works a treat!!!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|