+ Post New Thread
Page 2 of 7 FirstFirst 123456 ... LastLast
Results 16 to 30 of 100
Windows 7 Thread, Shared Start Menu based on what's installed! in Technical; Weuse something called desktop administrator, made by a company called ICT Networks, based in Stoke. It does exactly this, so ...
  1. #16

    Join Date
    Jan 2009
    Location
    United Kingdom
    Posts
    229
    Thank Post
    22
    Thanked 9 Times in 9 Posts
    Rep Power
    13
    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!

  2. #17
    mcrompton01's Avatar
    Join Date
    May 2006
    Location
    Burntwood
    Posts
    44
    Thank Post
    1
    Thanked 10 Times in 7 Posts
    Rep Power
    18
    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
    Code:
    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
    Code:
    '########################################################################################################################
    '#															#
    '#	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

  3. 2 Thanks to mcrompton01:

    FN-GM (19th May 2011), MicrodigitUK (18th May 2011)

  4. #18
    AlexB's Avatar
    Join Date
    Jul 2006
    Location
    Warwickshire
    Posts
    373
    Thank Post
    37
    Thanked 39 Times in 35 Posts
    Rep Power
    23
    *chuckles*

  5. #19

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,044
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    Quote Originally Posted by mcrompton01 View Post
    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
    Code:
    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
    Code:
    '########################################################################################################################
    '#															#
    '#	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

  6. #20
    mcrompton01's Avatar
    Join Date
    May 2006
    Location
    Burntwood
    Posts
    44
    Thank Post
    1
    Thanked 10 Times in 7 Posts
    Rep Power
    18
    Yes it does the /MIR switch on the startup script mirrors the master copy.

  7. Thanks to mcrompton01 from:

    FN-GM (18th May 2011)

  8. #21

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,044
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    Quote Originally Posted by mcrompton01 View Post
    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

  9. #22
    mcrompton01's Avatar
    Join Date
    May 2006
    Location
    Burntwood
    Posts
    44
    Thank Post
    1
    Thanked 10 Times in 7 Posts
    Rep Power
    18
    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?

  10. #23

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,044
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    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

  11. #24

    Join Date
    Oct 2005
    Location
    East Midlands
    Posts
    738
    Thank Post
    17
    Thanked 105 Times in 65 Posts
    Rep Power
    37
    Quote Originally Posted by mcrompton01 View Post
    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.

  12. #25
    mcrompton01's Avatar
    Join Date
    May 2006
    Location
    Burntwood
    Posts
    44
    Thank Post
    1
    Thanked 10 Times in 7 Posts
    Rep Power
    18
    Quote Originally Posted by FN-GM View Post
    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?

  13. #26

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,044
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    Quote Originally Posted by mcrompton01 View Post
    I expect you have, but have you copied the robocopy.exe into the same location as the Startup script?
    I also tried that still didn't work. Interestingly when i did that and run the script on Windows 7 it stopped working on there.

    Thanks

  14. #27
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,013
    Thank Post
    120
    Thanked 282 Times in 260 Posts
    Rep Power
    108
    Quote Originally Posted by FN-GM View Post
    I also tried that still didn't work. Interestingly when i did that and run the script on Windows 7 it stopped working on there.

    Thanks
    Alter the script to use a full path to robocopy or put it in a "known location" such as c:\windows\system32.

  15. #28

    Hightower's Avatar
    Join Date
    Jun 2008
    Location
    Cloud 9
    Posts
    4,920
    Thank Post
    494
    Thanked 690 Times in 444 Posts
    Rep Power
    241
    Don't know if people are still looking for ideas but one our new network we're using Group Policy Preferences. I've created a GPO called SHORTCUTS All Users and another called SHORTCUTS Staff, then in the preferences part of the GPO I add all the shortcuts. For stuff like SIMS.net it obviously goes in the staff GPO.

    On logon, the shortcuts are created if the link is valid (i.e. the software is installed). If the software is installed and then removed, so is the shortcut. It works really well from my testing.

  16. #29

    Join Date
    Aug 2007
    Posts
    817
    Thank Post
    99
    Thanked 65 Times in 47 Posts
    Rep Power
    26
    When I run the user script i get:
    Line 129, Char 12, Expected "then" ?
    Is there anything to edit in the user scipt? The startup script runs fine.

    are you missing a ' from the start of this line?
    If the Icon File contains multiple files (e.g. an array of icons) perform the action to remove this reference

    Last edited by burgemaster; 19th May 2011 at 09:00 AM.

  17. #30

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,044
    Thank Post
    888
    Thanked 1,727 Times in 1,490 Posts
    Blog Entries
    12
    Rep Power
    453
    Quote Originally Posted by ChrisH View Post
    Alter the script to use a full path to robocopy or put it in a "known location" such as c:\windows\system32.
    Just tried this and it doesnt make a different i am afraid.

    Thanks

SHARE:
+ Post New Thread
Page 2 of 7 FirstFirst 123456 ... LastLast

Similar Threads

  1. Roaming profile start menu not merging with local start menu
    By OverWorked in forum Windows Server 2008 R2
    Replies: 1
    Last Post: 1st February 2011, 03:10 PM
  2. Desktop & Start Menu based on the computer
    By darren5972 in forum Windows Server 2000/2003
    Replies: 2
    Last Post: 10th November 2010, 09:30 PM
  3. Installed JoomlaXplorer but now top menu not working
    By ben_snclc in forum EduGeek Joomla 1.5 Package
    Replies: 2
    Last Post: 6th July 2010, 04:54 PM
  4. Office 2007 installed on shared drive?
    By Ben-BSH in forum Office Software
    Replies: 7
    Last Post: 23rd March 2010, 12:22 PM
  5. Replies: 24
    Last Post: 23rd January 2009, 12:09 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
  •