Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

I Solved: Default User / All User Start Menu & Task Bar Customizat


  • Please log in to reply
3 replies to this topic

#1
Phylum

Phylum

    Newbie

  • Member
  • 13 posts
  • Joined 05-February 09
I'm preparing an image and I'd like to pin some of the more frequently used applications to the Task Bar and Start Menu as we did with the Quick Launch bar in Windows XP. (We don't want to use the Quick Launch Bar; we want our users to leverage Windows 7's built-in features, and why not?)
I haven't found much on this subject, but from probing around, it appears that applications pinned to the Start Menu and the Task Bar are stored in:
C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu
C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

On the assumption that the location above is correct, if I want to apply a specific configuration to all users, would I
  • Create C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu (since it doesn't exist by default)
  • Create C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar (again, doesn't exist)
  • Copy the files from a preconfigured profile into the newly created 'Default User' folders

In addition, I'm looking to remove certain items that show up on the Start Menu & Task Bar by default, like Windows Media Player & Explorer for starters, and adding the Switch between Windows ('Flip 3-D') button that was present in Vista, but removed in Windows 7. (Users might find it handy to click a button then use left/up or down/right or the mouse scroll wheel to flip through apps vs dealing with two buttons. )

I've researched the 'Default User' copy profile issue, found a number of blogs and instructions online, even from other forums,

But, they didn't specificaly say whether or not the customizations I wanted to make would follow.

How do I go about setting this up? Has this been done before?
Do I try the 'enabler' workaround and try to copy the Administrator profile over the Default profile? (Will it really work?)

Just seeking instruction & confirmation.

Edited by Phylum, 17 May 2010 - 09:48 AM.



How to remove advertisement from MSFN

#2
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,878 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
I do that to the start menu with my app but taskbar I haven't been able to do even with someones vbs script.
I use attrib cmds on these cause they are hidden and must be setup same way, open folder and you'll see what I mean, mess up and it's not pretty :lol: if you are just going to copy then maybe it will work.

I copy C:\Users\YOURNAME\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu
I also export a reg file HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage2 but those are specific settings like Windows Explorer set the way I like it

I use cmd files to do these things right now but was looking at OEM folders cause I seen 1 oem place things there.
Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#3
Phylum

Phylum

    Newbie

  • Member
  • 13 posts
  • Joined 05-February 09
Thanks for the reply.

Per at least one, if not more, of the links I included, they advised against that action:
* - Coping a customized profile, and associated registry entries, over to the Default profile.
The primary reason was because of the hard-coded user GUID (I believe) that's still associated with files & registry settings copied.

Although setting the copyprofile to true in the unattend.xml does seem to get the majority of the settings, several obvious items, and presumably many more less obvious ones, remain incorrectly configured - that is to say the Windows 7 default vs what I want it to be. My guess is that the pinned taskbar & start menu objects are not only updated on the file system somewhere, perhaps in the location I listed in my previous post, but also, a binary registry entry may be updated as well to include the new application this making these types of changes difficult to identify.

Edited by Phylum, 16 March 2010 - 11:16 PM.


#4
Phylum

Phylum

    Newbie

  • Member
  • 13 posts
  • Joined 05-February 09
To say 'there's nothing I hate more than someone saying "I fixed it" or "I found the solution" in a forum and not post the solution' would be a lie as there are many, many, things competing for that same level of hate. (Ok so hate is a strong word, but darn it people it makes it nearly impossible for others to learn or otherwise solve their issues when you don't circle back with confirmation that suggestions worked, or if you found something on your own.)

I'm very much pro-open source and sharing the wealth of knowledge, following my Father's example, so I've circled back to close the loop.

So, for what its worth I believe I have found a solution to this...
For starters, if you want XYZ apps pinned to the start menu or taskbar, you'll need to create a script that invokes the Pin command on the apps in question. I decided an array was the simplest thing to do. This script runs during the users first logon and is called via wscript because I don't need them seeing a dos box or clicking 'OK' on every echo. I feel this process is very slow and will explore a PoSH alternative/replacement. This was found online and I modified to suit.
'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 2009
'
' NAME: Pin & Unpin items to/from Start Menu & Taskabar
'
' AUTHOR: Phylum , 
' DATE  : 4/8/2010
'
' COMMENT: 
'
'==========================================================================

Dim sPath, sPinSMArray, sPinTBArray, sUnpinTBArray, PinItem
Dim sMOW, sMOO, sFOX, sLN, sNuance, siMAN, sEXP, sWMP
Const CSIDL_COMMON_PROGRAMS = &H17 
Const CSIDL_PROGRAMS = &H2 

Set fso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Shell.Application") 
Set wshshell = CreateObject("WScript.Shell")
Set oAllUsersProgramsFolder = oShell.NameSpace(CSIDL_COMMON_PROGRAMS)

sPath = oAllUsersProgramsFolder.Self.Path & "\"
sMOW = "Microsoft Office Word 2007.lnk"
sMOO = "Microsoft Office Outlook 2007.lnk"
sFOX = "Mozilla Firefox.lnk"
sLN = "Notes.lnk"
sNuance = "Nuance PDF Professional 6\PDF Converter Professional.lnk"
siMAN = "iManage.lnk"
sEXP = wshshell.ExpandEnvironmentStrings("%WinDir%") & "\Explorer.exe"
sWMP = wshshell.ExpandEnvironmentStrings("%ProgramFiles%") & "\Windows Media Player\wmplayer.exe"

sPinSMArray = Array(sLN,sFOX,sMOO,sMOW,sNuance,siMAN)
sPinTBArray = Array(sMOO,sMOW,sFOX,siMAN)
sUnpinTBArray = Array(sEXP,sWMP)

dim strScriptHost, output_echo
strScriptHost = LCase(Wscript.FullName)

If Right(strScriptHost, 11) = "wscript.exe" Then
    output_echo = False
Else
    output_echo = True
End If

Dim item
For Each item In sPinSMArray
	If Not fso.FileExists(sPath & item) Then
		PinItem = False
		debugecho "File, " & item & ", to pin does not exist in " & sPath & "."
		debugecho "Please check the input and try again."
		'WScript.quit
	Else
		PinSM(sPath & item)
	End If
Next

For Each item In sPinTBArray
	If Not fso.FileExists(sPath & item) Then
		PinItem = False
		debugecho "File, " & item & ", to pin does not exist in " & sPath & "."
		debugecho "Please check the input and try again."
		'WScript.quit
	Else
		PinTB(sPath & item)
	End If
Next

For Each item In sUnpinTBArray
	If Not fso.FileExists(item) Then
		PinItem = False
		debugecho "File, " & item & ", to unpin does not exist in " & sPath & "."
		debugecho "Please check the input and try again."
		'WScript.quit
	Else
		UnpinTB(item)
	End If
Next


Function PinSM(shortcut)
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set oShell = CreateObject("Shell.Application") 
	
	sFolder = fso.GetParentFolderName(shortcut)
	sFile = fso.GetFileName(shortcut)

	debugecho "Pinning " & sFolder & "\" & sFile & " to Start Menu."
	Err.Clear
			
	Set oFolder = oShell.NameSpace(sFolder)
	Set oFolderItem = oFolder.ParseName(sFile)
	Set colVerbs = oFolderItem.Verbs

	For Each itemverb In oFolderItem.Verbs
		If Replace(itemverb.name, "&", "") = "Pin to Start Menu" Then itemverb.DoIt
	Next
End Function

Function PinTB(shortcut)
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set oShell = CreateObject("Shell.Application") 
	
	sFolder = fso.GetParentFolderName(shortcut)
	sFile = fso.GetFileName(shortcut)

	debugecho "Pinning " & sFolder & "\" & sFile & " to Taskbar."
	Err.Clear
			
	Set oFolder = oShell.NameSpace(sFolder)
	Set oFolderItem = oFolder.ParseName(sFile)
	Set colVerbs = oFolderItem.Verbs
	
	For Each itemverb In oFolderItem.Verbs
		If Replace(itemverb.name, "&", "") = "Pin to Taskbar" Then itemverb.DoIt
	Next
End Function

Function UnpinTB(shortcut)
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set oShell = CreateObject("Shell.Application") 
	
	sFolder = fso.GetParentFolderName(shortcut)
	sFile = fso.GetFileName(shortcut)

	debugecho "Unpinning " & sFolder & "\" & sFile & " from Taskbar."
	Err.Clear
			
	Set oFolder = oShell.NameSpace(sFolder)
	Set oFolderItem = oFolder.ParseName(sFile)
	Set colVerbs = oFolderItem.Verbs
	
	For Each itemverb In oFolderItem.Verbs
		If Replace(itemverb.name, "&", "") = "Unpin from Taskbar" Then itemverb.DoIt
	Next
End Function

Function debugecho(msg)
	if output_echo Then
		wscript.echo msg
	end if
end Function

There are loads of useless icons on the Start Menu that are seemingly impossible to remove, like Sticky Notes, displaySwitch, Calculator etc. After scouring the file system for ages and checking and rechecking the registry and combing Google et al, I uncovered that the aforementioned shortcuts (and others) listed on the Start Menu are located in:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist
There are two GUIDs in that location but they're 'encrypted', albeit very poorly. Microsoft decided to use the ol' rot13 encryption for the entries for whatever reason.
Encrypting/Decrypting something with ROT13 is very simple
Function Rot13Fixer(sString)
	Dim n, i, StringROT
	For i=1 To Len(sString)
		' We don't want to convert numbers.
		If Not IsNumeric(Mid(sString,i,1)) Then
			individual_asc = Asc(Mid(sString,i,1))
			'WScript.Echo "IASC: " & Chr(individual_asc) & " (" & individual_asc & ")"
			If individual_asc >= 97 And individual_asc <=109 Then
				individual_asc = individual_asc +13
				'WScript.Echo "IASC+13.1: " & Chr(individual_asc) & " (" & individual_asc & ")"
			Else
				If individual_asc >= 110 And individual_asc <= 122 Then
					individual_asc = individual_asc -13
					'WScript.Echo "IASC-13.1: " & Chr(individual_asc) & " (" & individual_asc & ")"
				Else
					If individual_asc >= 65 And individual_asc <= 77 Then
						individual_asc = individual_asc +13
						'WScript.Echo "IASC+13.2: " & Chr(individual_asc) & " (" & individual_asc & ")"
					Else
						If individual_asc >= 78 And individual_asc <= 90 Then
							individual_asc = individual_asc -13
							'WScript.Echo "IASC-13.2: " & Chr(individual_asc) & " (" & individual_asc & ")"
						End If
					End If
				End If
			End If
			StringROT = StringROT + Chr(individual_asc)
		Else StringROT = StringROT + Mid(sString,i,1)
		End If
		'WScript.Echo StringROT
	Next
	Rot13Fixer = StringROT
End Function

Now that I can properly decrypt Rot13, and as such the contents of that registry location, I don't have to worry about hard coding GUID's, which probably change from machine to machine, in the script. The following functions read the path, enumerate the Keys then enumerate the Values under each key decrypting accordingly.
Function EnumKeys(HKEY,Path)
	Dim EKHKPath, GUIDPath, arrSubKeys, i
	Select Case HKEY
		Case "HKCU", "HKEY_CURRENT_USER"
			Const HKCU = &H80000001
			EKHKPath = HKCU
		Case "HKLM", "HKEY_LOCAL_MACHINE"
			Const HKLM = &H80000002
			EKHKPath = HKLM
		Case "HKU", "HKEY_USERS"
			Const HKU = &H80000003
			EKHKPath = HKU
		Case "HKCR", "HKEY_CLASSES_ROOT"
			Const HKCR = &H80000000
			EKHKPath = HKCR
		Case "HKCC", "HKEY_CURRENT_CONFIG"
			Const HKCC = &H80000005
			EKHKPath = HKCC
		Case "HKDD", "HKEY_DYN_DAT"
			Const HKDD = &H80000006
			EKHKPath = HKDD
		Case Else
			WScript.Echo "ERROR: Invalid HKEY Type Specified (" & EKHKPath & ")"
			WScript.echo "Please use HKCU, HKLM etc, or the long name equivalent."
			WScript.Sleep(15000)
			WScript.Quit
	End Select
	
	Set objReg=GetObject("winmgmts:\\.\root\default:StdRegProv")
	objReg.EnumKey EKHKPath, Path, arrSubKeys

	if isarray(arrSubKeys) Then
		For i=0 to UBound(arrSubKeys)
			GUIDPath = Path & "\" & arrSubKeys(i) & "\Count"
			'WScript.Echo "GuidPath: " & GUIDPath
			EnumValues HKEY,GUIDPath
			
 		Next
	end If

End Function

Function EnumValues(HKEY,Path)
	Dim EVHKPath, arrValueNames, arrValueTypes, i
	
	const REG_SZ = 1
	const REG_EXPAND_SZ = 2
	Const REG_BINARY = 3
	Const REG_DWORD = 4
	Const REG_MULTI_SZ = 7
 
	Select Case HKEY
		Case "HKCU", "HKEY_CURRENT_USER"
			Const HKCU = &H80000001
			EVHKPath = HKCU
		Case "HKLM", "HKEY_LOCAL_MACHINE"
			Const HKLM = &H80000002
			EVHKPath = HKLM
		Case "HKU", "HKEY_USERS"
			Const HKU = &H80000003
			EVHKPath = HKU
		Case "HKCR", "HKEY_CLASSES_ROOT"
			Const HKCR = &H80000000
			EVHKPath = HKCR
		Case "HKCC", "HKEY_CURRENT_CONFIG"
			Const HKCC = &H80000005
			EVHKPath = HKCC
		Case "HKDD", "HKEY_DYN_DAT"
			Const HKDD = &H80000006
			EVHKPath = HKDD
		Case Else
			WScript.Echo "ERROR: Invalid HKEY Type Specified (" & EVHKPath & ")"
			WScript.echo "Please use HKCU or the long name equivalent, HKEY_LOCAL_MACHINE."
			WScript.Sleep(15000)
			WScript.Quit
	End Select

	Set oReg=GetObject("winmgmts:\\.\root\default:StdRegProv")
	oReg.EnumValues EVHKPath, Path, arrValueNames, arrValueTypes
	
	if isarray(arrValueNames) Then
		For i=0 to UBound(arrValueNames)
			'WScript.Echo "Unencrypted Value Name: " & arrValueNames(i)
			arrValueNames(i) = Rot13Fixer(arrValueNames(i))
    		'WScript.Echo "Value Name: " & arrValueNames(i)
' #region Disabled code
' 	    	Select Case arrValueTypes(i)
'         		Case REG_SZ
' 		    		WScript.Echo "Data Type: String"
' 		        Case REG_EXPAND_SZ
'     				WScript.Echo "Data Type: Expanded String"
'     		    Case REG_BINARY
'     	    	    WScript.Echo "Data Type: Binary"
'         		Case REG_DWORD
' 					WScript.Echo "Data Type: DWORD"
'     		    Case REG_MULTI_SZ
' 					WScript.Echo "Data Type: Multi String"
' 			End Select
' #endregion
		'WScript.Echo "this: " & HKEY & " " & Path & " " & arrValueNames(i)
		FixStartMenu HKEY, Path, arrValueNames(i)
		Next
	End If
End Function

From there I call yet another function to remove the entries that match (InStr()) words stored in an array.
Example:
mylist = Array("snippingtool","calculator",..."displayswitch")
For each item in Array
     If ((Instr(1,RegPath,mylist,1) > 0) Then
         delete the registry key
     End if
Next

Thank you Jesus!

Edited by Phylum, 19 May 2010 - 10:38 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users