+ Post New Thread
Results 1 to 7 of 7
Scripts Thread, I had a great start menu control idea. in Coding and Web Development; Ok first up this really isn't my idea, somone at RM gets credit for this. I was solving a local ...
  1. #1

    Join Date
    Jun 2006
    Location
    Belfast, N\'Ireland
    Posts
    190
    Thank Post
    10
    Thanked 9 Times in 7 Posts
    Rep Power
    19

    I had a great start menu control idea.

    Ok first up this really isn't my idea, somone at RM gets credit for this. I was solving a local app install issue on our managed c2k network when I stumbled across how they control user start menus with respect to what apps are available on any given machine and I want to adapt it for our own network but I lack the scripting skills. Its very simple so somone that knows VB fucntions in detail can probably write this in a dozen lines.

    I want to have a full start menu with all possible installed apps in the mandatory profile that users get when they log on. I then want to run a logon script which sets hidden property on any shortcut with an invalid target. The result being a start menu which contains only groups and apps that are on that machine.

    The limit of my scripting in VB is unfortunatly recursively renaming directorys and copying files and folders with the odd mapped network drive or printer map added. I'm going to have a go at this anyway after school today but if anyone knows the functions I need to get the target property of a shortcut and to set extended attributes on a file that would be a big help.

  2. #2

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: I had a great start menu control idea.

    Recursion maybe a bit fiddly with VBS. What I would suggest is that you use the batch command FOR /R as a wrapper which then calls VBS script for all the shortcut stuff on each filer/folder.

  3. #3

    Join Date
    Jan 2006
    Location
    Surburbia
    Posts
    2,178
    Thank Post
    74
    Thanked 307 Times in 243 Posts
    Rep Power
    115

    Re: I had a great start menu control idea.

    It would take about 10 lines in Jscript to recursively scan and simply echo file/folder names. Is recursion more difficult in VBS?

    Anyway you can use Wshell.CreateShortcut pointed at an existing link to get the target path. The Scripting.FileSystemObject File object has a property you can use to get or set attributes.

  4. #4
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: I had a great start menu control idea.

    Recursion is trivial in VBS. Just create a sub which scans the contents of a specified folder and then calls itself to scan any sub-folders.

  5. #5

    Join Date
    Feb 2007
    Location
    Leicestershire
    Posts
    274
    Thank Post
    1
    Thanked 5 Times in 5 Posts
    Rep Power
    27

    Re: I had a great start menu control idea.

    have you got a way to detect if the shortcut points to an invalid target?

  6. #6

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,417
    Thank Post
    644
    Thanked 965 Times in 665 Posts
    Blog Entries
    2
    Rep Power
    328

    Re: I had a great start menu control idea.

    I think I read somewhere RM uses the presence of an icon in the shortcut target to determine the hidden/visible property of it.

  7. #7

    Join Date
    Jan 2006
    Location
    Surburbia
    Posts
    2,178
    Thank Post
    74
    Thanked 307 Times in 243 Posts
    Rep Power
    115

    Re: I had a great start menu control idea.

    Just create a sub which scans the contents of a specified folder
    No big difference then. I can see the "for /" case, but learning how to do recursive script isn't a bad thing and it's adaptable to similar problems e.g. trawling through AD OUs and objects.

    have you got a way to detect if the shortcut points to an invalid target?
    I don't see why this wouldn't work (jscript, easily changed to VBS):

    var Lnk = WSH.CreateShortcut(PathToLnkFile);

    if (!FSO.FileExists(Lnk.TargetPath))
    {//target is missing



SHARE:
+ Post New Thread

Similar Threads

  1. Start Menu redirection help!
    By wesleyw in forum Windows
    Replies: 5
    Last Post: 26th February 2008, 03:04 PM
  2. Start menu redirection
    By Andi in forum Network and Classroom Management
    Replies: 28
    Last Post: 5th December 2007, 02:48 PM
  3. Start Menu Issue in XP
    By rixi in forum Windows
    Replies: 1
    Last Post: 18th October 2007, 05:48 PM
  4. XP Start Menu Problem
    By Gatt in forum Windows
    Replies: 1
    Last Post: 12th July 2007, 09:30 AM
  5. right click start menu wierdness
    By browolf in forum Windows
    Replies: 1
    Last Post: 14th October 2005, 02:33 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •