Jump to content

I had a great start menu control idea.


Recommended Posts

Posted

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.

Posted

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.

Posted
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...