Jump to content

Shared Start Menu based on what's installed!


Recommended Posts

Posted

We are currently using shared start menus at the moment for the entire school, and all shortcuts mare shown regardless of whether the software is installed or not.

 

How can I only display shortcuts in the start menu for applications installed?

Posted
arthur; you could use that if you've installed the software via a policy which is linked to a group in AD, use the group as a security setting in effect, but it's not the same as something that simply doesn't show a short cut to anything that isn't there.
  • Thanks 1
Posted
Theoretically I suppose you could redirect to a local folder on each pc then have a script setup to copy all shortcuts accross and then delete/hide any dead shortcuts on boot... haven't looked into this at all though so it might take too long to process etc
  • 3 weeks later...
Posted
We are currently using shared start menus at the moment for the entire school, and all shortcuts mare shown regardless of whether the software is installed or not.

 

How can I only display shortcuts in the start menu for applications installed?

I think you need Windows 7 enterprise for folder redirection.

Posted

Hi

 

Have you considered using GPO preferences. You can create a group say for all users who have Adobe Professional installed and target them using GPO preferences. The users who are not in this group won't get the shortcuts/icons, however the PC will still have Adobe installed.

 

Regards

Sukh

Posted
We have a redirected menu that everyone gets (actually two menus – one staff one pupil) which covers all the standard installs that are deployed whole school. In addition to that, any software that is particular to one machine has its shortcut placed in a folder locally on the pc. A logon script copies any shortcuts in the folder into the current users profile, job done.
  • Thanks 1
  • 4 weeks later...
Posted

Hi,

 

Just wondering if anyone has had any more ideas regarding this please? I dont want to be messing about with access-based enumeration as it can get very complex.

 

A logon script copies any shortcuts in the folder into the current users profile, job done.

 

Can i take a look at this script please :)

 

Thanks

  • 4 weeks later...
Posted
Use Group Policy Preferences to sculpt the existing start menu on computer startup, you can use checks to looks for each individual .exe of each program and also automatically remove the shortcuts if the program has been uninstalled. It adds about 20 seconds to computer startup but there is no redirection or user based login scripting so an actual login is really fast. Depending on how you deploy your software you can just call gpupdate to update the start menu while users are logged in and the they can use it without a reboot.
Posted (edited)

I also use GPP, as well as a couple of other things.

 

I redirect my menu to a local folder on the C:\ Drive (C:\Environments\Startmenus) this is done because I have found that a redirection to the network caused the start menu to lag significantly.

 

There are several different folders within this (One for Staff, one for Students etc - done so that icons for SIMS etc are not visable from student logins)

 

These folders are created by GPP, and populated with an MSI which includes all of the shortcuts for site licensed products. The MSI is deployed by Group Policy so that if needed I can recall it and send out a new one with updated links.

 

I create Security groups of machines to distribute certain pieces of software. Within the Group Policy that I use to distribute the programs msi I also use GPP to distribute the shortcuts to the redirected folders.

Edited by Mr.Ben
  • 3 weeks later...
Posted
Weuse something called desktop administrator, made by a company called ICT Networks, based in Stoke. It does exactly this, so you can assign shortcuts based on both users witha shared profile, and, a computers OU/location in this instance. The same goes for printers, also based on OU/ location. We are currently trying our best to get windows7 into our organisation within the next twelve months, once we have our policies sorted out so they work reliably!
Posted

We are in the process of moving from RM to a vanilla solution and wanted something that work ins in the same way as the RM method, check to see if the Target and Icon can be found, if they can show the shortcut. If all the shortcuts within a folder a hidden also hide the folder.

 

I have come up with a script based solution and execution time at logon on a Virtual PC running on an i5, 4gb RAM, 2008R2 (base OS) takes approx: 5-8 seconds (according to event log).

 

It works in the following way:

Startup Script: to copy the start menu to a local folder on the workstation using robocopy and some extra params to also copy secyuirty settings so you can restrict folders by security group (for example out MIS folder is staff only)

 

Logon Script: At logon the script accesses the local folder and hides/unhides folders/files depending on what can be accessed (icon path and target).

 

Folder Redirection: All users have their start menu redirected to the local path on the machine.

 

StartUp Script - Placed in the NetLogon Folder

Dim strSource, strDest
strSource = "\\KNG-NAS-001\Shared Resources$\Start Menu"
strDest = "C:\Configuration\Start Menu"
Set wshShell = WScript.CreateObject ("WSCript.shell") 	
wshshell.run "robocopy """ & strSource & """ """ & strDest & """ /E /MIR /COPY:DATS /SECFIX /Z /W:20 /R:1", 6, True
'The above runs: robocopy and copies the startmenu on the server to the workstation (creating folders if needed) 
'robocopy Source Destination Params
'/E = Copy subfolders, including empty ones
'/MIR = Mirrors the folder structure (e.g. deletes folders/files if they have been deleted at the source)
'/COPY:DATS = Copy the following file/folder attributes: D=Data, A=Attributes, T=Timestamps, S=Security=NTFS
'/SECFIX = Reapplies the folder security and ensures that it mirrors the source
'/W:20 = Wait 20 seconds before retrying any failed operation
'/R:1 = Retry any errors once
'/Z = Allows the copy process to auto restart if case of a network error
set wshshell = nothing
strSource = Null
strDest = Null

 

Logon Script - Placed in the Netlogon Folder

'########################################################################################################################
'#															#
'#	Name: 		Configure User Start Menu									#
'#	Description: 	Script to check the start menu file (.lnk) target and icon path is accessible			#
'#			If they are not the script will hide the file, if they are then the file will be unhidden	#
'#															#
'#	Author:		Mark Crompton - Kingsmead Technology College							#
'#	Date:		04/05/2011											#
'#	Version:	1.00												#
'#															#
'########################################################################################################################

'On Error Resume Next

'Define the variables used for this script
Dim strStartMenuPath, datScriptStart, datScriptEnd
Dim WshNetwork, strLoggedOnUser, intHidden, intVisible
Dim strProcessName, strComputer, objWMIService

'Define Consts that can be used to log data
const EVENTLOG_SUCCESS = 0
const EVENTLOG_ERROR = 1
const EVENTLOG_WARNING = 2
const EVENTLOG_INFORMATION = 4
const EVENTLOG_AUDIT_SUCCESS = 8
const EVENTLOG_AUDIT_FAILURE = 16

'Create the objects that are needed to ensure the script runs correctly
Set WshNetwork = WScript.CreateObject("WScript.Network") 
Set WshShell = WScript.CreateObject("WScript.Shell") 
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

'Set variables required by this script
intHidden = 0
intVisible = 0
strProcessName = "robocopy.exe"
strComputer = "."
strLoggedOnUser = WshNetwork.UserName

'################################################## START THE SCRIPT ##################################################
'Record the date/time the script started
datScriptStart = Now() 

'Start writing the event log information
strMessage = strMessage & "StartMenu Modification: " & vbNewLine

'Parent folder of all the start menus on the local machine
strStartMenuPath = "C:\Configuration\Start Menu"

'Default to say the process (strProcessName) is running
ProcessRunning = True

'Check to see if the process (StrProcessName) is running, if it is wait 3 seconds and try again
Do While ProcessRunning = True
If objWMIService.ExecQuery("Select * from Win32_Process WHERE Name = '" &  strProcessName & "'").Count = 0 then
	ProcessRunning = False
	WScript.Sleep(3000)
End If
Loop

'Check the startmenu folder exists (strStartMenuPath)
FolderExists strStartMenuPath


ViewSubFolders strStartMenuPath

'Record when the script finished
datScriptEnd = Now() 

'Log Information to the Computers Application Event Log
strMessage = strMessage & vbNewLine & vbNewLine & "Current User: " & strLoggedOnUser
strMessage = strMessage & vbNewLine & vbNewLine & "Start Menu Location: " & strStartMenuPath
strMessage = strMessage & vbNewLine & vbNewLine & "Shortcuts Hidden: " & intHidden
strMessage = strMessage & vbNewLine & "Shortcuts Visible: " & intVisible
strMessage = strMessage & vbNewLine & vbNewLine & "Executed in: " & DateDiff("s",  datScriptStart, datScriptEnd) & " seconds"

'Actually write data to the even log
WshShell.LogEvent strEventNo, strMessage

'########################################################################
'#									#
'#	Function to check if the folder exists				#
'#									#
'########################################################################

Sub FolderExists(strFolder)
set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FolderExists(strFolder & "\") Then
  		objFSO.CreateFolder(strFolder)	
End If
End Sub

'########################################################################
'#									#
'#	Function to enumerate all the folders within a specified folder	#
'#									#
'########################################################################

Sub ViewSubFolders(strFolder)
'Define the variables for this function
Dim objFSO, objFolder, SubFolder, file, strShortcutPath
Dim objShortCut, strTarget, strIcon, intNoFiles, intFilecount

'Create the objects for this function (Filesystem)
Set WshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")	
Set objFolder = objFSO.GetFolder(strFolder)	

'Check to see if the user has access to this folder, if not hide the folder
If HasAccess(strFolder) = True then
	'Get a list of files within the current folder (strFolder)
	Set objFiles = objFolder.Files

	intNoFiles = objFiles.Count 'The number of files in this folder
	intFileCount = 1 'this is set to 1 so it auto includes the desktop.ini file
	
	For Each file in objFiles
		'Get the full path to the shortcut
		strShortcutPath = file.path

		'If it is a shortcut file (.lnk) do some checks any other kind of file will be viewable by default (for example .url)
		if lcase(right(file.name,4)) = ".lnk" then
			'Create a shortcut object
			Set objShortCut = WshShell.CreateShortcut(strShortcutPath)

			'Get the target path of the shortcut
			strTarget = ReplaceEnvVariables(objShortCut.TargetPath)

			If the Icon File contains multiple files (e.g. an array of icons) perform the action to remove this reference
			If instr(objShortCut.IconLocation,",") > 0 then
				strIcon = ReplaceEnvVariables(left(objShortCut.IconLocation,instr(objShortCut.IconLocation,",")-1))		
				if trim(strIcon) = "" then
					strIcon = objShortCut.TargetPath
				End If
			Else
				strIcon = ReplaceEnvVariables(objShortCut.TargetPath)
			End If				
			
			'If the Target and Icon File can be found on the computer unhide the file, else hide the file from view
			If objFSO.FileExists(strTarget) AND objFSO.FileExists(strIcon) Then 
				FileVisibility file.path, False
			Else
				FileVisibility file.path, True
				intFileCount = intFileCount + 1
			End If
		end if
	Next

	'If the total number of hidden files is equal to the total number of files in the folder, hide the folder
	If (intFileCount = intNoFiles) AND (UBound(Split(strFolder,"\")) > 4) then 'Hide the folder if all the shortcuts are hidden
		FolderVisibility strFolder, True
	Else
		FolderVisibility strFolder, False	
	End If

	'Call this function for every subfolder that exists in the current path (strFolder)
	For Each SubFolder in objFolder.SubFolders
        	ViewSubFolders SubFolder
	Next
Else
	'Hide the folder from the users view
	FolderVisibility strFolder, True
End If

Set objFolder = Nothing
Set objFSO = Nothing
End Sub

'################################################################################
'#										#
'#	Function to replace all the environment variables with actual path	#
'#										#
'################################################################################

Function ReplaceEnvVariables(strPath)
Dim objShell, strNewPath

Set objShell = CreateObject("WScript.Shell")
strNewPath = ucase(strPath)

strNewPath = Replace(strNewPath, "%DEFAULTUSERPROFILE%", objShell.ExpandEnvironmentStrings("%DEFAULTUSERPROFILE%"))
strNewPath = Replace(strNewPath, "%PROFILESFOLDER%", objShell.ExpandEnvironmentStrings("%PROFILESFOLDER%"))
strNewPath = Replace(strNewPath, "%PROGRAMFILES%", objShell.ExpandEnvironmentStrings("%PROGRAMFILES%"))
strNewPath = Replace(strNewPath, "%PROGRAMFILES(X86)%", objShell.ExpandEnvironmentStrings("%PROGRAMFILES(X86)%"))
strNewPath = Replace(strNewPath, "%SYSTEM%", objShell.ExpandEnvironmentStrings("%SYSTEM%"))
strNewPath = Replace(strNewPath, "%SYSTEM16%", objShell.ExpandEnvironmentStrings("%SYSTEM16%"))
strNewPath = Replace(strNewPath, "%SYSTEM32%", objShell.ExpandEnvironmentStrings("%SYSTEM32%"))
strNewPath = Replace(strNewPath, "%SYSTEMPROFILE%", objShell.ExpandEnvironmentStrings("%SYSTEMPROFILE%"))
strNewPath = Replace(strNewPath, "%SYSTEMROOT%", objShell.ExpandEnvironmentStrings("%SYSTEMROOT%"))
strNewPath = Replace(strNewPath, "%WINDIR%", objShell.ExpandEnvironmentStrings("%WINDIR%"))

ReplaceEnvVariables = strNewPath

set objShell = Nothing
End Function

'########################################################################
'#									#
'#	Function to set the visibility of a file with the start menu	#
'#									#
'########################################################################

Sub FileVisibility(strFilePath, HideFile)
Dim objFSO, objFile
set objFSO = CreateObject("Scripting.FileSystemObject") 

set objFile = objFSO.GetFile(strFilePath)			

If HideFile Then 
	objFile.Attributes = 2
	intHidden = intHidden + 1
ElseIf Not HideFile Then
	objFile.Attributes = 0
	intVisible = intVisible +1
End If
End Sub

'################################################################################
'#										#
'#	Function to set the visibility of a subfolder within the start menu	#
'#										#
'################################################################################


Sub FolderVisibility(strFolderPath, HideFolder)
Dim objFSO, objFolder
set objFSO = CreateObject("Scripting.FileSystemObject") 

set objFolder = objFSO.GetFolder(strFolderPath)			
If HideFolder Then 
	objFolder.Attributes = 2
ElseIf Not HideFolder Then
	objFolder.Attributes = 0
End If
End Sub

'########################################################################
'#									#
'#	Function to check if the logged on user has access to the folder#
'#									#
'########################################################################

Function Hasaccess(folderpath)
Set objFSO = CreateObject("Scripting.FileSystemObject")	
If objFSO.FileExists(folderpath & "\desktop.ini") then
	Hasaccess = True
Else
	Hasaccess = False
End If	
End Function

 

Hope this is helpful.

 

Mark Crompton

  • Thanks 2
Posted
We are in the process of moving from RM to a vanilla solution and wanted something that work ins in the same way as the RM method, check to see if the Target and Icon can be found, if they can show the shortcut. If all the shortcuts within a folder a hidden also hide the folder.

 

I have come up with a script based solution and execution time at logon on a Virtual PC running on an i5, 4gb RAM, 2008R2 (base OS) takes approx: 5-8 seconds (according to event log).

 

It works in the following way:

Startup Script: to copy the start menu to a local folder on the workstation using robocopy and some extra params to also copy secyuirty settings so you can restrict folders by security group (for example out MIS folder is staff only)

 

Logon Script: At logon the script accesses the local folder and hides/unhides folders/files depending on what can be accessed (icon path and target).

 

Folder Redirection: All users have their start menu redirected to the local path on the machine.

 

StartUp Script - Placed in the NetLogon Folder

Dim strSource, strDest
strSource = "\\KNG-NAS-001\Shared Resources$\Start Menu"
strDest = "C:\Configuration\Start Menu"
Set wshShell = WScript.CreateObject ("WSCript.shell") 	
wshshell.run "robocopy """ & strSource & """ """ & strDest & """ /E /MIR /COPY:DATS /SECFIX /Z /W:20 /R:1", 6, True
'The above runs: robocopy and copies the startmenu on the server to the workstation (creating folders if needed) 
'robocopy Source Destination Params
'/E = Copy subfolders, including empty ones
'/MIR = Mirrors the folder structure (e.g. deletes folders/files if they have been deleted at the source)
'/COPY:DATS = Copy the following file/folder attributes: D=Data, A=Attributes, T=Timestamps, S=Security=NTFS
'/SECFIX = Reapplies the folder security and ensures that it mirrors the source
'/W:20 = Wait 20 seconds before retrying any failed operation
'/R:1 = Retry any errors once
'/Z = Allows the copy process to auto restart if case of a network error
set wshshell = nothing
strSource = Null
strDest = Null

 

Logon Script - Placed in the Netlogon Folder

'########################################################################################################################
'#															#
'#	Name: 		Configure User Start Menu									#
'#	Description: 	Script to check the start menu file (.lnk) target and icon path is accessible			#
'#			If they are not the script will hide the file, if they are then the file will be unhidden	#
'#															#
'#	Author:		Mark Crompton - Kingsmead Technology College							#
'#	Date:		04/05/2011											#
'#	Version:	1.00												#
'#															#
'########################################################################################################################

'On Error Resume Next

'Define the variables used for this script
Dim strStartMenuPath, datScriptStart, datScriptEnd
Dim WshNetwork, strLoggedOnUser, intHidden, intVisible
Dim strProcessName, strComputer, objWMIService

'Define Consts that can be used to log data
const EVENTLOG_SUCCESS = 0
const EVENTLOG_ERROR = 1
const EVENTLOG_WARNING = 2
const EVENTLOG_INFORMATION = 4
const EVENTLOG_AUDIT_SUCCESS = 8
const EVENTLOG_AUDIT_FAILURE = 16

'Create the objects that are needed to ensure the script runs correctly
Set WshNetwork = WScript.CreateObject("WScript.Network") 
Set WshShell = WScript.CreateObject("WScript.Shell") 
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

'Set variables required by this script
intHidden = 0
intVisible = 0
strProcessName = "robocopy.exe"
strComputer = "."
strLoggedOnUser = WshNetwork.UserName

'################################################## START THE SCRIPT ##################################################
'Record the date/time the script started
datScriptStart = Now() 

'Start writing the event log information
strMessage = strMessage & "StartMenu Modification: " & vbNewLine

'Parent folder of all the start menus on the local machine
strStartMenuPath = "C:\Configuration\Start Menu"

'Default to say the process (strProcessName) is running
ProcessRunning = True

'Check to see if the process (StrProcessName) is running, if it is wait 3 seconds and try again
Do While ProcessRunning = True
If objWMIService.ExecQuery("Select * from Win32_Process WHERE Name = '" &  strProcessName & "'").Count = 0 then
	ProcessRunning = False
	WScript.Sleep(3000)
End If
Loop

'Check the startmenu folder exists (strStartMenuPath)
FolderExists strStartMenuPath


ViewSubFolders strStartMenuPath

'Record when the script finished
datScriptEnd = Now() 

'Log Information to the Computers Application Event Log
strMessage = strMessage & vbNewLine & vbNewLine & "Current User: " & strLoggedOnUser
strMessage = strMessage & vbNewLine & vbNewLine & "Start Menu Location: " & strStartMenuPath
strMessage = strMessage & vbNewLine & vbNewLine & "Shortcuts Hidden: " & intHidden
strMessage = strMessage & vbNewLine & "Shortcuts Visible: " & intVisible
strMessage = strMessage & vbNewLine & vbNewLine & "Executed in: " & DateDiff("s",  datScriptStart, datScriptEnd) & " seconds"

'Actually write data to the even log
WshShell.LogEvent strEventNo, strMessage

'########################################################################
'#									#
'#	Function to check if the folder exists				#
'#									#
'########################################################################

Sub FolderExists(strFolder)
set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FolderExists(strFolder & "\") Then
  		objFSO.CreateFolder(strFolder)	
End If
End Sub

'########################################################################
'#									#
'#	Function to enumerate all the folders within a specified folder	#
'#									#
'########################################################################

Sub ViewSubFolders(strFolder)
'Define the variables for this function
Dim objFSO, objFolder, SubFolder, file, strShortcutPath
Dim objShortCut, strTarget, strIcon, intNoFiles, intFilecount

'Create the objects for this function (Filesystem)
Set WshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")	
Set objFolder = objFSO.GetFolder(strFolder)	

'Check to see if the user has access to this folder, if not hide the folder
If HasAccess(strFolder) = True then
	'Get a list of files within the current folder (strFolder)
	Set objFiles = objFolder.Files

	intNoFiles = objFiles.Count 'The number of files in this folder
	intFileCount = 1 'this is set to 1 so it auto includes the desktop.ini file
	
	For Each file in objFiles
		'Get the full path to the shortcut
		strShortcutPath = file.path

		'If it is a shortcut file (.lnk) do some checks any other kind of file will be viewable by default (for example .url)
		if lcase(right(file.name,4)) = ".lnk" then
			'Create a shortcut object
			Set objShortCut = WshShell.CreateShortcut(strShortcutPath)

			'Get the target path of the shortcut
			strTarget = ReplaceEnvVariables(objShortCut.TargetPath)

			If the Icon File contains multiple files (e.g. an array of icons) perform the action to remove this reference
			If instr(objShortCut.IconLocation,",") > 0 then
				strIcon = ReplaceEnvVariables(left(objShortCut.IconLocation,instr(objShortCut.IconLocation,",")-1))		
				if trim(strIcon) = "" then
					strIcon = objShortCut.TargetPath
				End If
			Else
				strIcon = ReplaceEnvVariables(objShortCut.TargetPath)
			End If				
			
			'If the Target and Icon File can be found on the computer unhide the file, else hide the file from view
			If objFSO.FileExists(strTarget) AND objFSO.FileExists(strIcon) Then 
				FileVisibility file.path, False
			Else
				FileVisibility file.path, True
				intFileCount = intFileCount + 1
			End If
		end if
	Next

	'If the total number of hidden files is equal to the total number of files in the folder, hide the folder
	If (intFileCount = intNoFiles) AND (UBound(Split(strFolder,"\")) > 4) then 'Hide the folder if all the shortcuts are hidden
		FolderVisibility strFolder, True
	Else
		FolderVisibility strFolder, False	
	End If

	'Call this function for every subfolder that exists in the current path (strFolder)
	For Each SubFolder in objFolder.SubFolders
        	ViewSubFolders SubFolder
	Next
Else
	'Hide the folder from the users view
	FolderVisibility strFolder, True
End If

Set objFolder = Nothing
Set objFSO = Nothing
End Sub

'################################################################################
'#										#
'#	Function to replace all the environment variables with actual path	#
'#										#
'################################################################################

Function ReplaceEnvVariables(strPath)
Dim objShell, strNewPath

Set objShell = CreateObject("WScript.Shell")
strNewPath = ucase(strPath)

strNewPath = Replace(strNewPath, "%DEFAULTUSERPROFILE%", objShell.ExpandEnvironmentStrings("%DEFAULTUSERPROFILE%"))
strNewPath = Replace(strNewPath, "%PROFILESFOLDER%", objShell.ExpandEnvironmentStrings("%PROFILESFOLDER%"))
strNewPath = Replace(strNewPath, "%PROGRAMFILES%", objShell.ExpandEnvironmentStrings("%PROGRAMFILES%"))
strNewPath = Replace(strNewPath, "%PROGRAMFILES(X86)%", objShell.ExpandEnvironmentStrings("%PROGRAMFILES(X86)%"))
strNewPath = Replace(strNewPath, "%SYSTEM%", objShell.ExpandEnvironmentStrings("%SYSTEM%"))
strNewPath = Replace(strNewPath, "%SYSTEM16%", objShell.ExpandEnvironmentStrings("%SYSTEM16%"))
strNewPath = Replace(strNewPath, "%SYSTEM32%", objShell.ExpandEnvironmentStrings("%SYSTEM32%"))
strNewPath = Replace(strNewPath, "%SYSTEMPROFILE%", objShell.ExpandEnvironmentStrings("%SYSTEMPROFILE%"))
strNewPath = Replace(strNewPath, "%SYSTEMROOT%", objShell.ExpandEnvironmentStrings("%SYSTEMROOT%"))
strNewPath = Replace(strNewPath, "%WINDIR%", objShell.ExpandEnvironmentStrings("%WINDIR%"))

ReplaceEnvVariables = strNewPath

set objShell = Nothing
End Function

'########################################################################
'#									#
'#	Function to set the visibility of a file with the start menu	#
'#									#
'########################################################################

Sub FileVisibility(strFilePath, HideFile)
Dim objFSO, objFile
set objFSO = CreateObject("Scripting.FileSystemObject") 

set objFile = objFSO.GetFile(strFilePath)			

If HideFile Then 
	objFile.Attributes = 2
	intHidden = intHidden + 1
ElseIf Not HideFile Then
	objFile.Attributes = 0
	intVisible = intVisible +1
End If
End Sub

'################################################################################
'#										#
'#	Function to set the visibility of a subfolder within the start menu	#
'#										#
'################################################################################


Sub FolderVisibility(strFolderPath, HideFolder)
Dim objFSO, objFolder
set objFSO = CreateObject("Scripting.FileSystemObject") 

set objFolder = objFSO.GetFolder(strFolderPath)			
If HideFolder Then 
	objFolder.Attributes = 2
ElseIf Not HideFolder Then
	objFolder.Attributes = 0
End If
End Sub

'########################################################################
'#									#
'#	Function to check if the logged on user has access to the folder#
'#									#
'########################################################################

Function Hasaccess(folderpath)
Set objFSO = CreateObject("Scripting.FileSystemObject")	
If objFSO.FileExists(folderpath & "\desktop.ini") then
	Hasaccess = True
Else
	Hasaccess = False
End If	
End Function

 

Hope this is helpful.

 

Mark Crompton

 

Hi,

 

If i make changes to the master start menu on the server. For example delete a shortcut or rename a folder. Will these changes automatically passdown on the next reboot please?

 

Thanks

Posted
Yes it does the /MIR switch on the startup script mirrors the master copy.

 

Thanks, how did you get on with Windows XP Machines please? I stilled the resource kits and the VBS script no longer errors but it still doesnt do the job. It works a treat on Windows 7.

 

Thanks

Posted

Ok, one problem there Windows XP was not part of the remit for this as the whole site will be moving to Windows 7 Enterprise so I have not done any backward compatibility testing as its not needed here!

 

Sorry, I'll do my best to help which script is 'not' doing its job?

Posted
Sorry, I'll do my best to help which script is 'not' doing its job?

 

Just doesnt copy the stuff down. As i say i get an error because it cant find robocopy but once i install it no error happens. if you happen to know anything if you could let me know :)

Posted
We are in the process of moving from RM to a vanilla solution and wanted something that work ins in the same way as the RM method, check to see if the Target and Icon can be found, if they can show the shortcut. If all the shortcuts within a folder a hidden also hide the folder.

 

I have come up with a script based solution and execution time at logon on a Virtual PC running on an i5, 4gb RAM, 2008R2 (base OS) takes approx: 5-8 seconds (according to event log).

 

It works in the following way:

Startup Script: to copy the start menu to a local folder on the workstation using robocopy and some extra params to also copy secyuirty settings so you can restrict folders by security group (for example out MIS folder is staff only)

 

Logon Script: At logon the script accesses the local folder and hides/unhides folders/files depending on what can be accessed (icon path and target).

 

Folder Redirection: All users have their start menu redirected to the local path on the machine.

 

StartUp Script - Placed in the NetLogon Folder

 

Hope this is helpful.

 

Mark Crompton

 

Hi Mark,

 

That code looks good! We're in the same process here as well with Migrating from CC3 and are exploring vanilla options as well as others. One of our technicians have also done a login script which does similar to your script.

 

One of the approach we have looked at is to keep a master Start Menu on the server and use NTFS permission on different program sets (or folders) and shortcuts. The permissions are based on security groups etc i.e. Students, Teaching Staff, Admin Users etc.

 

The login scripts then basically only copies shortcuts and folders the user accesses because the script runs in the context of the user and places then in the user's profile. We chose to redirect the user's start menu to their profile folder under %USERPROFILE%\Start Menu. I thinking RM does like this as well. Have tested on couple of PCs with different programs etc.

 

Also the script copies only shortcuts that are valid i.e. programs are installed on the computer the script is being run on (user is logging on to). It works well and executes pretty quickly as well.

 

If someone would like script then let us know.

 

Ash.

Posted
Just doesnt copy the stuff down. As i say i get an error because it cant find robocopy but once i install it no error happens. if you happen to know anything if you could let me know :)

 

I expect you have, but have you copied the robocopy.exe into the same location as the Startup script?

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...