From 8e3200dd5fbe82ba683c499c8bc6377a97601bcc Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:11:21 +0100 Subject: [PATCH] feat(TASKBARPINS): rewrite --- .../tweaks/qol/taskbar/config-pins.yml | 54 ++++++-- src/playbook/Executables/Shortcuts/Brave.lnk | Bin 2436 -> 0 bytes .../Executables/Shortcuts/File Explorer.lnk | Bin 407 -> 0 bytes .../Executables/Shortcuts/Firefox.lnk | Bin 1513 -> 0 bytes .../Executables/Shortcuts/Google Chrome.lnk | Bin 2319 -> 0 bytes .../Executables/Shortcuts/LibreWolf.lnk | Bin 1753 -> 0 bytes .../Executables/Shortcuts/Microsoft Edge.lnk | Bin 2438 -> 0 bytes src/playbook/Executables/TASKBARPINS.cmd | 76 ---------- src/playbook/Executables/TASKBARPINS.ps1 | 131 ++++++++++++++++++ 9 files changed, 171 insertions(+), 90 deletions(-) delete mode 100644 src/playbook/Executables/Shortcuts/Brave.lnk delete mode 100644 src/playbook/Executables/Shortcuts/File Explorer.lnk delete mode 100644 src/playbook/Executables/Shortcuts/Firefox.lnk delete mode 100644 src/playbook/Executables/Shortcuts/Google Chrome.lnk delete mode 100644 src/playbook/Executables/Shortcuts/LibreWolf.lnk delete mode 100644 src/playbook/Executables/Shortcuts/Microsoft Edge.lnk delete mode 100644 src/playbook/Executables/TASKBARPINS.cmd create mode 100644 src/playbook/Executables/TASKBARPINS.ps1 diff --git a/src/playbook/Configuration/tweaks/qol/taskbar/config-pins.yml b/src/playbook/Configuration/tweaks/qol/taskbar/config-pins.yml index 45238434f6..2edc3bc0aa 100644 --- a/src/playbook/Configuration/tweaks/qol/taskbar/config-pins.yml +++ b/src/playbook/Configuration/tweaks/qol/taskbar/config-pins.yml @@ -7,28 +7,54 @@ actions: # [BitConverter]::ToString($(Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "Favorites").Favorites) -replace '-' | clip - !taskKill: {name: 'explorer'} - - !run: - exe: 'TASKBARPINS.cmd' + + # Config pins + - !registryKey: + path: 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband' + - !registryKey: + path: 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband' + operation: add + - !registryValue: + path: 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband' + value: 'FavoritesVersion' + data: '3' + type: REG_DWORD + - !registryValue: + path: 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband\AuxilliaryPins' + value: 'MailPin' + data: '0' + type: REG_DWORD + - !registryValue: + path: 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband\AuxilliaryPins' + value: 'CopilotPWAPin' + data: '0' + type: REG_DWORD + # Not sure what this does + # - !registryValue: + # path: 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband\AuxilliaryPins' + # value: 'TFLPin' + # data: '0' + # type: REG_DWORD + + # Set new pins + - !powerShell: + command: '.\TASKBARPINS.ps1' option: '!install-another-browser' exeDir: true - - !run: - exe: 'TASKBARPINS.cmd' - args: '"Brave"' + - !powerShell: + command: '.\TASKBARPINS.ps1 "Brave"' option: 'browser-brave' exeDir: true - - !run: - exe: 'TASKBARPINS.cmd' - args: '"Firefox"' + - !powerShell: + command: '.\TASKBARPINS.ps1 "Firefox"' option: 'browser-firefox' exeDir: true - - !run: - exe: 'TASKBARPINS.cmd' - args: '"Google Chrome"' + - !powerShell: + command: '.\TASKBARPINS.ps1 "Google Chrome"' option: 'browser-chrome' exeDir: true - - !run: - exe: 'TASKBARPINS.cmd' - args: '"LibreWolf"' + - !powerShell: + command: '.\TASKBARPINS.ps1 "LibreWolf"' option: 'browser-librewolf' exeDir: true - !run: {exe: 'explorer.exe', runas: 'currentUser', wait: false} diff --git a/src/playbook/Executables/Shortcuts/Brave.lnk b/src/playbook/Executables/Shortcuts/Brave.lnk deleted file mode 100644 index 9676aa1bd68c54f79bb36347cf40ce88a6df5e94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2436 zcmds2ZAg<*6h4+8MFpA`CY1|P4Bc|-ate~$%(faiTxmbv%IRKhw7K6S zR6i1>B#S8MgCq*8pZy83ghZk&h={(ZAdQHgb2Z;#lb|55`*O~`_uO;u^W1aKd#{~{ zqLSu86WtY>N}m=JY0$pd8o%f9vyrG>#$r)7TzGkW$>>N_^4c8X86~u;HqJ|;RL8Tj zLCxzzPyCt33n()?yK4olw-idM*L16$^rD?!`K2X+9OY%3%S{Ji3eiG}ruPF!%0_MJ zmE$csc$tN#3b;k|JNrMAgB0>p9kh#lpj}EH@{&wJcoakLMca!nmvTr)Zqd#nEqZ#& zC!^qy47Mzk!Ae1&C>&#= zWeP+4E5?MtI1v$J!5c#uhE}xwzz70C5g1j|`(O-{!(q2s7{fZfj|uE!5~C$G8gnL( zUfoA-V-}exfX|Ca)_{KqwV&$6`V!*C$G^Jrnn6R=imO4^$xSkqL|Fe&#P!=Uzf<*e zoOEE`G!-AB{lHiW;rMc`g>VT#5+L&-1FxE2#iJ%9l|%8@DK4L;)Z>+dl9|~!{k5S+ zmm*L0v}VQM7?c&s6bN`dHLj4yUoWYwDG^((!N=(mMDm10x@gFT?S@29>!Cxm4XL9e zX;wXZ5=vnQHZv*0$7UX;G|M4K5rStV3l)Ohzhhzk=ZKN^orHXdBkD<;$^(%GX@8Oj zoKJJRq|G>e^%_h=X3Tyug^&GB4$kf9{XgvaYQ)pjlaBf(gs;&>=-;T>-FfHUHrv(H za(~Xlp%fmgg5VeG*@>EqTMq6E`2$+L+w0DAXH(&uh7MzMrKxXtZ29F6%f6m{Vp+Pz z{x0G2QChq%S9<%q@wK?e7h?TZtgUxCoX^{Kmfp4-Ew{cU9!o#vd*FkepCC$w@LlhO z)!9;ds z*t-vO7i>L0IQB?8HvDN7>?!PIh4|d}W8*UJmYf{&^^8^*UFSjZ*fYymi25_3gHizD vRj(}fm0aowSo^HSy56FucAmJG9eC9jA7gfp51+GjMps$4_jVm-`_J+NDwu}i diff --git a/src/playbook/Executables/Shortcuts/File Explorer.lnk b/src/playbook/Executables/Shortcuts/File Explorer.lnk deleted file mode 100644 index 777d819730924a71662ef6e811dfeb5fdf62308a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 407 zcmeZaU|?VrVFHp236FoK(+Zmeku^_0m%v=UJvvLCj-L*T_9~3 z91#4dE5dD$kA?H@Kf;sMX5^j|gn3jL#sJb~P{pAdKJzQ*TY9g!@bHT6!>gY?f#R$n zb@D(g4aB}c`;&pTi=u4pa;=?B>=1Y&?}MGr~NXkAJQLMg)hI&WD0F3qky zKN?7}I^Eed6lX}Y%s9<*S$j(%X3a50B^W(^z)1@bJZ8lc&ot$NPm^FFgOiVu8!T+F zd*K>RyAhp}Xe&0gsmbPxqLsW78Gni7JA3BHpCUD%=)jJ4oZG*%7CkROqyox-wE*Xg zwFcm}69@(t0u!3{%Svd%4>G%*)o!Z;XO<<8<+lu2e=sU-{2IV

4VHNlVwvL@ zYBEq7qWt^Le6&SGol(%Y0ZzkGjBi$!w-4OkzV+G}sW1NNh>GVb0Hma|1e#lwHabt(&e$OFXfmVI0D!J{QVZGDSF=Y#PD{awLx;wH-}5I`%Ni^ zJKsW%MRhoa_P{P~Fb9nT3UN*JK;n-A;WFVO*(APX*b^vK_#~m9h`t_DPdeCnWfF7> z*60A9NfuTe#=cTV2K4CIY~)469sdKxTh5%1XEVu#Pe$2PqBI+zohW_ZqUF$HOaC*+;}(F)UaYN*PCq^p zeB%WT=DiFXcEBFa4osFy>woX+Tvfm^xTOM2RFe^+=V7*cLlUK%r_0Br z?~2^h3YNsVLa?AJD1Tt5YmsM!npbAhN#n7kW)8(&?a?4_? z5<5!xuJD0}`M7iF8=1*ZBDuh8$qU$ea+8Og)QAEYoep_@2F{bL7!cxxv#~xP z`V?x1$C2kyQPKORj)E48c3^xadGPa&A8l`R+cQib69zBPwya#?!|&!Zk!s^$|14~) zE6tU&=dAjNrUKoApNU=ai{58m=y{b$hrrTtCAb=-0kJZvK=CXC;Nh}8Uh1yEYs9;vZwIKwXvC(ikb2GUC^@6W3$; diff --git a/src/playbook/Executables/Shortcuts/LibreWolf.lnk b/src/playbook/Executables/Shortcuts/LibreWolf.lnk deleted file mode 100644 index 7c827255f862ca71c3aa58fc85c0164d2c59d0eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1753 zcmeZaU|?VrVFHp23lEYh-I^QfZrx;LV1V!$esO_ifdVL? zo>7EBKH!1>1%+2unF5P$a4={a7|fMq(08_qK~V_d^e`BL8M5JFxq=JF3{O-44Di$45*24JKF6y>KECFUx)W#*(7$M|F>6{Uvf=cL8tfLP@~mR@QF&}?&H!07>l z2tSECB4V%vObi~+NHI7wSOM)L%|s2dbYXW#CPOkXfJK1e#m>O6KsC6sxFj{#r6{v3 zRh5W9%S_G(1@N!}stmylmB8#&0!(bVz-&>rdGyIvob$jp)&jS8g6l$W>^^vTSu!DcV3`Ok5*Zd) z0%^nGfZ&Z{xh`va3p|#4IOr|0t>}>jif4eV^Z?@de>Y^$I}zsE*_6D)_S=3HkT?tg E0FG|vkN^Mx diff --git a/src/playbook/Executables/Shortcuts/Microsoft Edge.lnk b/src/playbook/Executables/Shortcuts/Microsoft Edge.lnk deleted file mode 100644 index afdfc92f5d53d1f2014a59e1842bb31eae06398a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2438 zcmds2OH5Ny5S=PjjK=WOh|%~ksVQnJ1;I-Ev{q`d#WqyL=!=$5DX;byN~APOT$m8S z8lxLGL^MQPD2WR-Mq=2oa6?G6LF2;WCm}@C_=`~&o_hH&!x#!Nz zo3Rj)EN2czq5(dV@u`kT!1`MMu`F}Ph^%66XHbYemVN#db`PE!k)3TX-ZaqD&?e|DBQb$1oSQ)v<%UYDy$w)zPU2#C71a{Q_5K%J92WIo zH&X?0)NyP<;A@~}ZhOz9ZAEosq=3rmT~4CXNxO2p_9m0F`+i7iH#9t-%7EL2dl2Q2 zBVkQ~HNDMdDK{{rrk^avk$y~Rao)L?q^AHL564>roD%T*I9dlh!-6fhUn&;J8*~D% z+8M&(#uO(UJ;UOYj1gWy>CM@QOAv_TxYbyNIR54MdIY=z%yzL^1!m+1XM*Q~?~R4W zGB6X;$kya{HPv_pqvUZ01!YKEk}p$5FDWz4ty$r=S$7Fm-Bu@P6yBigG0qnnkZH?V#uTokrwqD$9zB)Ym zP&FET-wOF^cJM0jM)2>+sZJrA>RyM@Z&~3zLaiviMd%G$%(YyW_m_R~u8_qJ&IYr# zu@cN$2}(GTFw{{SzU?o&8rggN*3d*W4>Gtk4iohTrtOJ(%;b#pV0Oo69s7;_7Omm# zx9sz4E_jC&kn^s|?g(dKs|p=gMa6v9LK3IVn3#bZOT9a nul && ( - echo] - for /f "usebackq tokens=3* delims= " %%b in (`reg query "HKU\%%a\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "AppData" 2^>nul ^| findstr /r /x /c:".*AppData[ ]*REG_SZ[ ].*" 2^>nul`) do ( - set "userAppdata=%%b" - ) - - if [!userAppdata!]==[] ( - echo Couldn't find AppData value for "%%a"! - ) else ( - echo Setting "%input%" taskbar shortcut for "%%a"... - echo ------------------------------------------------------------------------------------------------------ - - echo Clear current shortcuts and copy File Explorer - rmdir /s /q "!userAppdata!\%taskBarLocation%" > nul - mkdir "!userAppdata!\%taskBarLocation%" > nul - copy /y "Shortcuts\File Explorer.lnk" "!userAppdata!\%taskBarLocation%" > nul - - if "%browser%"=="true" ( - echo Copy browser shortcut - copy /y "Shortcuts\%input%.lnk" "!userAppdata!\%taskBarLocation%" > nul - ) - - echo Set in Registry - reg add "HKU\%%a\%rootKey%" /v "FavoritesResolve" /t REG_BINARY /d "%favoritesResolve%" /f > nul - reg add "HKU\%%a\%rootKey%" /v "Favorites" /t REG_BINARY /d "%favorites%" /f > nul - ) - ) -) \ No newline at end of file diff --git a/src/playbook/Executables/TASKBARPINS.ps1 b/src/playbook/Executables/TASKBARPINS.ps1 new file mode 100644 index 0000000000..14da2758f4 --- /dev/null +++ b/src/playbook/Executables/TASKBARPINS.ps1 @@ -0,0 +1,131 @@ +param ( + [string]$Browser +) + +# The names are used for the shortcuts in the taskbar +# If they're changed, e.g. 'Brave', then you need new Favorites & FavoritesResolve +# However, only changing the path seems to not be an issue +$programFiles = [Environment]::GetFolderPath('ProgramFiles') +$edge = 'Microsoft Edge' +$explorer = 'File Explorer' +$shortcuts = @{ + 'Brave' = @{ + RegFavoritesResolve = 'C40200004C0000000114020000000000C000000000000046830080002000000038DCEBF8DDE0D9018F25810DDEE0D9018F25810DDEE0D9017809000000000000010000000000000000000000000000003A013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90138DCEBF8DDE0D9018F25810DDEE0D9011400560031000000000026578C8210005461736B42617200400009000400EFBE26577C8226578C822E000000D499010000000C000000000000000000000000000000E3721D005400610073006B0042006100720000001600A80032007809000026578F82200042726176652E6C6E6B00440009000400EFBE26577C8226578F822E0000005E62060000000700000000000000000000000000000071751D00420072006100760065002E006C006E006B0000001800220000001E00EFBE02005500730065007200500069006E006E006500640000001800120000002B00EFBE8F25810DDEE0D9011800180000001D00EFBE020042007200610076006500000018000000930000001C000000010000001C0000002D00000000000000920000001100000003000000BEE87AE81000000000433A5C55736572735C557365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C42726176652E6C6E6B000060000000030000A058000000000000006465736B746F702D31646C64346430003AEC768D387A5741A7D5E116AEF015FAB2E44312214CEE11AE92000C29335CED3AEC768D387A5741A7D5E116AEF015FAB2E44312214CEE11AE92000C29335CED45000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000E3F2055EF8D5A6499004604854A49D84000000000000000000000000320300004C0000000114020000000000C0000000000000468300800020000000549E39A5246AD8012B113CA5246AD801A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000E4A63B761000000000433A5C55736572735C757365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D62356E36683339006E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A06E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A045000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000CE2181FCD4BF31408F25FF009E4345CA000000000000000000000000' + RegFavorites = '003A0100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90138DCEBF8DDE0D9018F25810DDEE0D9011400560031000000000026578C8210005461736B42617200400009000400EFBE26577C8226578C822E000000D499010000000C000000000000000000000000000000E3721D005400610073006B0042006100720000001600A80032007809000026578F82200042726176652E6C6E6B00440009000400EFBE26577C8226578F822E0000005E62060000000700000000000000000000000000000071751D00420072006100760065002E006C006E006B0000001800120000002B00EFBE8F25810DDEE0D9011800180000001D00EFBE02004200720061007600650000001800220000001E00EFBE02005500730065007200500069006E006E006500640000001800000000A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF' + Path = "$programFiles\BraveSoftware\Brave-Browser\Application\brave.exe" + } + 'Firefox' = @{ + RegFavoritesResolve = 'E20200004C0000000114020000000000C0000000000000468300800020000000C1EAB456F76CDA01C1EAB456F76CDA01CE99A8CBF66CDA01E1030000000000000100000000000000000000000000000056013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE12000000A8F97DA9776ADA018D804BF2F66CDA018D804BF2F66CDA01140056003100000000006258C3B910005461736B42617200400009000400EFBE62586DB96258C3B92E0000001E6B00000000030000000000000000000000000000005FE5D3005400610073006B0042006100720000001600C4003200E103000062584AB9200046697265666F782E6C6E6B00480009000400EFBE6258C7B96258C7B92E0000003C01000000000600000000000000000000000000000032BC4500460069007200650066006F0078002E006C006E006B0000001A00220000001E00EFBE02005500730065007200500069006E006E006500640000001A00120000002B00EFBE1E52B756F76CDA011A002E0000001D00EFBE0200330030003800300034003600420030004100460034004100330039004300420000001A000000950000001C000000010000001C0000002D00000000000000940000001100000003000000050CFEB61000000000433A5C55736572735C557365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46697265666F782E6C6E6B000060000000030000A058000000000000006465736B746F702D627562766D6A340086BE4F893A62684A86310928B4B0051FF351BD4AEAD8EE118995000C2903292886BE4F893A62684A86310928B4B0051FF351BD4AEAD8EE118995000C2903292845000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D00000068000000004800000090BB989C2A392A46865DFC96152B921F000000000000000000000000320300004C0000000114020000000000C0000000000000468300800020000000549E39A5246AD8012B113CA5246AD801A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000E4A63B761000000000433A5C55736572735C757365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D62356E36683339006E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A06E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A045000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000CE2181FCD4BF31408F25FF009E4345CA000000000000000000000000' + RegFavorites = '00560100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE12000000A8F97DA9776ADA018D804BF2F66CDA018D804BF2F66CDA01140056003100000000006258C3B910005461736B42617200400009000400EFBE62586DB96258C3B92E0000001E6B00000000030000000000000000000000000000005FE5D3005400610073006B0042006100720000001600C4003200E103000062584AB9200046697265666F782E6C6E6B00480009000400EFBE6258C7B96258C7B92E0000003C01000000000600000000000000000000000000000032BC4500460069007200650066006F0078002E006C006E006B0000001A00120000002B00EFBE1E52B756F76CDA011A002E0000001D00EFBE0200330030003800300034003600420030004100460034004100330039004300420000001A00220000001E00EFBE02005500730065007200500069006E006E006500640000001A00000000A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF' + Path = "$programfiles\Mozilla Firefox\firefox.exe" + } + 'LibreWolf' = @{ + RegFavoritesResolve = 'EA0200004C0000000114020000000000C0000000000000468300800020000000529D8535B6E0D901529D8535B6E0D901529D8535B6E0D901B904000000000000010000000000000000000000000000005C013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90158B7CE0121E0D90117C3C83EABE0D901140056003100000000002657655C11005461736B42617200400009000400EFBE2557E88D2657665C2E000000D4990100000006000000000000000000000000000000AC6601005400610073006B0042006100720000001600CA003200B90400002657695C20004C69627265576F6C662E6C6E6B004C0009000400EFBE2657695C2657695C2E000000DA780000000008000000000000000000000000000000AE018D004C00690062007200650057006F006C0066002E006C006E006B0000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE529D8535B6E0D9011C002E0000001D00EFBE0200380033004300310043003000460033004600410038003500320034004200310000001C000000970000001C000000010000001C0000002D00000000000000960000001100000003000000BEE87AE81000000000433A5C55736572735C557365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C4C69627265576F6C662E6C6E6B000060000000030000A058000000000000006465736B746F702D31646C64346430003AEC768D387A5741A7D5E116AEF015FAB13DA7E29E4CEE11AE93000C29335CED3AEC768D387A5741A7D5E116AEF015FAB13DA7E29E4CEE11AE93000C29335CED45000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000E3F2055EF8D5A6499004604854A49D84000000000000000000000000320300004C0000000114020000000000C0000000000000468300800020000000549E39A5246AD8012B113CA5246AD801A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000E4A63B761000000000433A5C55736572735C757365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D62356E36683339006E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A06E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A045000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000CE2181FCD4BF31408F25FF009E4345CA000000000000000000000000' + RegFavorites = '005C0100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90158B7CE0121E0D90117C3C83EABE0D901140056003100000000002657655C11005461736B42617200400009000400EFBE2557E88D2657665C2E000000D4990100000006000000000000000000000000000000AC6601005400610073006B0042006100720000001600CA003200B90400002657695C20004C69627265576F6C662E6C6E6B004C0009000400EFBE2657695C2657695C2E000000DA780000000008000000000000000000000000000000AE018D004C00690062007200650057006F006C0066002E006C006E006B0000001C00120000002B00EFBE529D8535B6E0D9011C002E0000001D00EFBE0200380033004300310043003000460033004600410038003500320034004200310000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00000000A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF' + Path = "$programfiles\LibreWolf\librewolf.exe" + } + 'Google Chrome' = @{ + RegFavoritesResolve = 'E60200004C0000000114020000000000C000000000000046830080002000000080E4020EB6E0D90180E4020EB6E0D9013AB600FBB5E0D901A0080000000000000100000000000000000000000000000054013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90158B7CE0121E0D90117C3C83EABE0D901140056003100000000002657185211005461736B42617200400009000400EFBE2557E88D265718522E000000D49901000000060000000000000000000000000000009CD11B015400610073006B0042006100720000001600C2003200A00800002657345C2000476F6F676C65204368726F6D652E6C6E6B00540009000400EFBE2657465C2657465C2E00000076780000000007000000000000000000000000000000C64BA80047006F006F0067006C00650020004300680072006F006D0065002E006C006E006B0000002000220000001E00EFBE02005500730065007200500069006E006E006500640000002000120000002B00EFBE80E4020EB6E0D90120001A0000001D00EFBE02004300680072006F006D0065000000200000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000BEE87AE81000000000433A5C55736572735C557365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C476F6F676C65204368726F6D652E6C6E6B000060000000030000A058000000000000006465736B746F702D31646C64346430003AEC768D387A5741A7D5E116AEF015FA933DA7E29E4CEE11AE93000C29335CED3AEC768D387A5741A7D5E116AEF015FA933DA7E29E4CEE11AE93000C29335CED45000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000E3F2055EF8D5A6499004604854A49D84000000000000000000000000320300004C0000000114020000000000C0000000000000468300800020000000549E39A5246AD8012B113CA5246AD801A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000E4A63B761000000000433A5C55736572735C757365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D62356E36683339006E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A06E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A045000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000CE2181FCD4BF31408F25FF009E4345CA000000000000000000000000' + RegFavorites = '00540100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90158B7CE0121E0D90117C3C83EABE0D901140056003100000000002657185211005461736B42617200400009000400EFBE2557E88D265718522E000000D49901000000060000000000000000000000000000009CD11B015400610073006B0042006100720000001600C2003200A00800002657345C2000476F6F676C65204368726F6D652E6C6E6B00540009000400EFBE2657465C2657465C2E00000076780000000007000000000000000000000000000000C64BA80047006F006F0067006C00650020004300680072006F006D0065002E006C006E006B0000002000120000002B00EFBE80E4020EB6E0D90120001A0000001D00EFBE02004300680072006F006D00650000002000220000001E00EFBE02005500730065007200500069006E006E006500640000002000000000A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF' + Path = "$programfiles\Google\Chrome\Application\chrome.exe" + } + $edge = @{ + RegFavoritesResolve = 'E50200004C0000000114020000000000C000000000000046830080002000000013ECDA0121E0D901EA00DD0121E0D9014D038B7320E0D90186090000000000000100000000000000000000000000000052013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90158B7CE0121E0D901EA00DD0121E0D901140056003100000000002557E88D10005461736B42617200400009000400EFBE2557E88D2557E88D2E000000D4990100000006000000000000000000000000000000A8B26A005400610073006B0042006100720000001600C0003200860900002557698D20004D4943524F537E312E4C4E4B0000560009000400EFBE2557E88D2557E88D2E000000D6990100000004000000000000000000000000000000B37BD2004D006900630072006F0073006F0066007400200045006400670065002E006C006E006B0000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBEEA00DD0121E0D9011C001A0000001D00EFBE02004D005300450064006700650000001C0000009C0000001C000000010000001C0000002D000000000000009B0000001100000003000000BEE87AE81000000000433A5C55736572735C557365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C4D6963726F736F667420456467652E6C6E6B000060000000030000A058000000000000006465736B746F702D31646C64346430003AEC768D387A5741A7D5E116AEF015FA5831EF36144CEE11AE90000C29335CED3AEC768D387A5741A7D5E116AEF015FA5831EF36144CEE11AE90000C29335CED45000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000E3F2055EF8D5A6499004604854A49D84000000000000000000000000320300004C0000000114020000000000C0000000000000468300800020000000EA00DD0121E0D9015961DF0121E0D901A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90158B7CE0121E0D9015961DF0121E0D901140056003100000000002557E88D11005461736B42617200400009000400EFBE2557E88D2557E88D2E000000D4990100000006000000000000000000000000000000A7085A005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBE2557E88D2557E88D2E000000D8990100000007000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE5961DF0121E0D9011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000BEE87AE81000000000433A5C55736572735C557365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D31646C64346430003AEC768D387A5741A7D5E116AEF015FA5931EF36144CEE11AE90000C29335CED3AEC768D387A5741A7D5E116AEF015FA5931EF36144CEE11AE90000C29335CED45000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000E3F2055EF8D5A6499004604854A49D84000000000000000000000000' + RegFavorites = '00560100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90158B7CE0121E0D901EA00DD0121E0D901140056003100000000002557E88D10005461736B42617200400009000400EFBE2557E88D2557E88D2E000000D4990100000006000000000000000000000000000000A8B26A005400610073006B0042006100720000001600C4003200860900002557698D20004D4943524F537E312E4C4E4B0000560009000400EFBE2557E88D2557E88D2E000000D6990100000004000000000000000000000000000000B37BD2004D006900630072006F0073006F0066007400200045006400670065002E006C006E006B0000001C00120000002B00EFBEEA00DD0121E0D9011C001A0000001D00EFBE02004D005300450064006700650000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C00000000A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE120000001AA557D820E0D90158B7CE0121E0D9015961DF0121E0D901140056003100000000002557E88D11005461736B42617200400009000400EFBE2557E88D2557E88D2E000000D4990100000006000000000000000000000000000000A7085A005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBE2557E88D2557E88D2E000000D8990100000007000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE5961DF0121E0D9011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF' + Path = "$([Environment]::GetFolderPath('ProgramFilesx86'))\Microsoft\Edge\Application\msedge.exe" + } + $explorer = @{ + RegFavoritesResolve = '320300004C0000000114020000000000C0000000000000468300800020000000549E39A5246AD8012B113CA5246AD801A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000E4A63B761000000000433A5C55736572735C757365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D62356E36683339006E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A06E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A045000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000CE2181FCD4BF31408F25FF009E4345CA000000000000000000000000' + RegFavorites = '00A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF' + Path = "$([Environment]::GetFolderPath('Windows'))\explorer.exe" + } +} +if ($Browser) { + if ($Browser -notin $shortcuts.Keys) { + Write-Error "Browser '$Browser' not listed!" + $Browser = $null + } elseif (!(Test-Path $shortcuts.$Browser.Path)) { + Write-Error "Browser '$Browser' path not found!" + $Browser = $null + } +} + +# Init shortcuts +$tmp = New-Item (Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $([System.Guid]::NewGuid())) -ItemType Directory -Force +function Add-Shortcut { + param ( + [string]$Temp = $tmp, + [string]$Path, + [string]$Destination + ) + + $Shortcut = (New-Object -ComObject WScript.Shell).CreateShortcut("$Temp\$Destination.lnk") + $Shortcut.TargetPath = $Path + $Shortcut.WorkingDirectory = Split-Path $Path + $Shortcut.Save() +} +Add-Shortcut -Path $($shortcuts.$explorer.Path) -Destination $explorer + +# Decide Registry Favorites +if ([string]::IsNullOrEmpty($Browser)) { # If Edge exists, pin it, otherwise, pin only File Explorer + $edgePath = $shortcuts.$edge.Path + if (Test-Path $edgePath) { + Add-Shortcut -Path $edgePath -Destination $edge + $Browser = $edge + $regTaskbar = $shortcuts.$edge + } else { + Write-Warning "Edge isn't installed." + $Browser = $explorer + $regTaskbar = $shortcuts.$explorer + } +} else { # Browser options + Add-Shortcut -Path $($shortcuts.$Browser.Path) -Destination $Browser + $regTaskbar = $shortcuts.$Browser +} + +# Set Registry changes +$reg = @{} +foreach ($entry in $regTaskbar.GetEnumerator()) { + if ($entry.Name -like 'Reg*') { + $reg.Add($entry.Name -replace 'Reg', $entry.Value) + } +} + +# Paths +$taskBarLocation = 'Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar' +$rootKey = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband' + +# Clearing taskbar, copying the shortcut, setting registry +$regPattern = 'AME_UserHive_|Volatile Environment' +foreach ($userKey in + (Get-ChildItem -Path "Registry::HKU" | Where-Object { + $_.Name -match "S-[0-9-]+(?!.*_)|$regPattern" + }).PsPath +) { + # If the 'Volatile Environment' key exists, that means it is a proper user. Built in accounts/SIDs don't have this key + if ((Get-ChildItem -Path $userKey | Where-Object { $_ -match $regPattern }).Count -ne 0) { + Write-Output "" + $sid = Split-Path $userKey -Leaf + $appData = Get-ItemPropertyValue "Registry::HKU\$sid\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" -Name 'AppData' -EA 0 + + if ([string]::IsNullOrEmpty($appData)) { + Write-Error "Couldn't find AppData value for $sid!" + } else { + $text = "Setting '$Browser' taskbar shortcut for '$sid'..." + Write-Output "$text`n$('-' * $text.Length)" + + Write-Output "Clearing current shortcuts..." + $taskBarAppData = "$appData\$taskBarLocation" + Get-ChildItem $taskBarAppData | Remove-Item -Force -Recurse + + Write-Output "Adding new shortcuts..." + Copy-Item -Path "$tmp\*" -Destination $taskBarAppData -Force + + Write-Output "Changing in Registry..." + $key = "$(Convert-Path $userKey)\$rootKey" + foreach ($entry in $reg.GetEnumerator()) { + reg add `"$key`" /v $($entry.Name) /t REG_BINARY /d `"$($entry.Value)`" /f | Out-Null + } + } + } +} \ No newline at end of file