script to pin shortcuts to Start menu

D

Debra

I have written a VB script to pin the Office 2007 shortcuts to the Start
Menu. Only problem is...it pins the .exe file, not a .lnk file. I would also
like to unpin the old Office links from the Start menu to clean things up.
How can I pin the .lnk files and not the .exe files?
Can this be done? I have not been able to find anything on the Internet.
Thanks,
Debra
 
D

Debra

Thanks David,
Here is what I put into my batch job...
@Echo Off
copy "%ALLUSERPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk"
"C:\Documents and Settings\All Users\Start Menu\Programs" /y

When I run my batch job I get the following error...
\Start Menu\Programs\Microsoft Office\*.lnk
The system cannot find the path specified.
0 files copied
Can you tell me what I am missing?
Thank you,
Debra
 
J

ju.c

You're not "pinning" to the start menu, you're just copying
start menu shortcuts from one folder to another start menu
folder.

Change the system variable, "%ALLUSERPROFILE%" to
"%UserProfile%"


ju.c
 
T

Tim Meddick

Debra,
The folder "Microsoft Office" can be either in the "All Users"
profile folder (C:\Documents and Settings\All Users\Start Menu) or in your
own profile's folder (C:\Documents and Settings\YOU\Start Menu where YOU
stands for your user name). So this BATCH file will copy either:

--------------- copy between lines ---------------

@Echo Off

if EXIST "%ALLUSERPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk" copy
"%ALLUSERPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk" "C:\Documents
and Settings\All Users\Start Menu" /y

if EXIST "%USERPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk" copy
"%USERPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk" "C:\Documents
and Settings\All Users\Start Menu" /y

--------------- copy between lines ---------------

(*NB I have left a space between each line in this batch file; please ensure
each 'line' is all on one line in the new batch file as line-wrap may have
made the lines appear altered in my post. There should only be three lines
in the end batch file)

This should do what you want without doing something totally unadvisable
like altering the definition of the Environment Variable "ALLUSERPROFILE" it
should remain as "C:\Documents and Settings\All Users"


==



Cheers, Tim Meddick, Peckham, London. :)
 
D

Debra

Tim,
Thank you and will try this because I am trying to pin to the Start Menu and
not just copy the links to the Programs Folder.
Thank you and I will post back either way.
Debra
 
T

Tim Meddick

Sorry, I have found a problem with the script I sent you earlier. Here is
another that stands a better chance:


--------------- copy between lines ---------------


@Echo Off

if EXIST "%ALLUSERSPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk" copy
"%ALLUSERSPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk"
"C:\Documents and Settings\All Users\Start Menu" /y

if EXIST "%USERPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk" copy
"%USERPROFILE%\Start Menu\Programs\Microsoft Office\*.lnk" "C:\Documents
and Settings\All Users\Start Menu" /y


--------------- copy between lines ---------------


(*NB I have left a space between each line in this batch file; please ensure
each 'line' is all on one line in the new batch file as line-wrap may have
made the lines appear altered in my post. There should only be three lines
in the end batch file)

It appears that I had left out an "S" in "%ALLUSERSPROFILES%"


==



Cheers, Tim Meddick, Peckham, London. :)
 
D

Debra

Tim,
I want the .lnk files to be pinned underneath the Start Menu. Just as if you
right click on the Word link and select Pin to Start Menu.
Your batch job worked great but not the location I'm looking for. Am I
making sense? I want the user to click on Start and see the shortcuts.
Thanks,
Debra
 
T

Tim Meddick

Debra,
I do see now! You must be using the "XP style" Start Menu NOT the
CLASSIC which I like to use. (If you use the classic menu the links become
a lot more prominent) But I know what you mean, but because I don't use
that style, I don't know how XP configures the "pinned to" part of the menu.
But I will try and look into it for you and post back as soon as I can.


==



Cheers, Tim Meddick, Peckham, London. :)
 
D

Debra

Tim,
I did not get the reg hack. And yes we do use the XP Start menu.
Unfortunetly I use Novell Groupwise and not Outlook.
It sounds like your solution would work if I could just figure it out.
Thanks for all your help on this.
Debra
 
T

Tim Meddick

Debra,
The contents of the file are just to 'crazy' (composed of much
binary data) to post here so that you could 'copy and paste' it back into a
..REG file. I am sorry. I was really hoping that you might be using Outlook
Express to read this group, but alas, it appears not (I should have known
that had I looked at the 'properties' of your post in my OE, very
unprofessional of me).
However, all is not lost. If you were to email me directly with
an email address I can send it to, I would be happy to do that. I have
tested the .reg file extensively on various [XP] computers and it does work
as you requested. 'Pinning' rather than just 'copying' the shortcuts to the
various MS Office components.

Email me here for the .reg file:

mailto: (e-mail address removed)

==


Cheers, Tim Meddick, Peckham, London. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Pin To Start Menu? 1
Pin to Start Menu Question 1
Criteria for "Pin To Start Menu" 6
Start Menu 2
Pin to start menu 5
Pin to Start Menu 1
Un-pin items from start menu? 4
Shortcuts Not Working 3

Top