Page 1 of 1 1
Topic Options
#119129 - 2004-05-06 03:53 PM Problem creating a specific type of shortcut
GSUK Offline
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
#119130 - 2004-05-06 04:39 PM Re: Problem creating a specific type of shortcut
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, easiest thing is to copy the structure.
what start-menu is all about is folders holding shortcuts.
thus, depending on what you have in the target folder though, just copying the folder to local drive does the trick.
_________________________
!

download KiXnet

Top
#119131 - 2004-05-06 04:56 PM Re: Problem creating a specific type of shortcut
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#119132 - 2004-05-06 05:14 PM Re: Problem creating a specific type of shortcut
GSUK Offline
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 Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#119134 - 2004-05-06 06:01 PM Re: Problem creating a specific type of shortcut
GSUK Offline
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
#119135 - 2004-05-06 06:08 PM Re: Problem creating a specific type of shortcut
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, after checking...
it's easiest done by creating the shortcut and copying that (it's actually a folder) to netlogon and copying it to startmenu.
why?
because, once you create this type of folder shortcut, you will actually create a folder and it's context will be:
Desktop.ini - the file that controls how the folder is viewed (in this case cascaded)
target.lnk - the actual link to that target directory
_________________________
!

download KiXnet

Top
#119136 - 2004-05-07 11:26 AM Re: Problem creating a specific type of shortcut
GSUK Offline
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 Offline
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 Offline
Starting to like KiXtart

Registered: 2004-03-10
Posts: 125
Thanks MightyR1!!! That works a treat!!!
Top
#119139 - 2004-05-07 03:29 PM Re: Problem creating a specific type of shortcut
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
weird, that is exactly what I told you to do but this time it worked you say?

weird indeed.
_________________________
!

download KiXnet

Top
#119140 - 2004-05-07 03:49 PM Re: Problem creating a specific type of shortcut
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Yep,

that's what I did... The trick is the attrin +R for the folder...
_________________________
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
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.112 seconds in which 0.073 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org