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 ...
-
12th February 2007, 12:42 PM #1
- Rep Power
- 16
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.
-
-
IDG Tech News
-
12th February 2007, 01:32 PM #2
- 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.
-
-
13th February 2007, 08:40 PM #3 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.
-
-
13th February 2007, 09:31 PM #4 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.
-
-
13th February 2007, 09:36 PM #5
- Rep Power
- 13
Re: I had a great start menu control idea.
have you got a way to detect if the shortcut points to an invalid target?
-
-
13th February 2007, 09:45 PM #6 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.
-
-
13th February 2007, 11:17 PM #7 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: 
Similar Threads
-
By wesleyw in forum Windows
Replies: 5
Last Post: 26th February 2008, 02:04 PM
-
By Andi in forum Network and Classroom Management
Replies: 28
Last Post: 5th December 2007, 01:48 PM
-
Replies: 1
Last Post: 18th October 2007, 04:48 PM
-
Replies: 1
Last Post: 12th July 2007, 08:30 AM
-
By browolf in forum Windows
Replies: 1
Last Post: 14th October 2005, 01: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
-
Forum Rules