From de927d3d8b97397f99c00c3253f650b11102662c Mon Sep 17 00:00:00 2001 From: Jason Igari-Szabo Date: Thu, 2 Apr 2026 01:46:54 +0200 Subject: [PATCH] initial scripts --- school/tube-pm-video-grabber.ps1 | 36 +++++++++++++++++++++++ windows/Disable-FolderTypeDiscovery.ps1 | 23 +++++++++++++++ windows/Set-FullContextMenu.ps1 | 38 +++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 school/tube-pm-video-grabber.ps1 create mode 100644 windows/Disable-FolderTypeDiscovery.ps1 create mode 100644 windows/Set-FullContextMenu.ps1 diff --git a/school/tube-pm-video-grabber.ps1 b/school/tube-pm-video-grabber.ps1 new file mode 100644 index 0000000..472b3fa --- /dev/null +++ b/school/tube-pm-video-grabber.ps1 @@ -0,0 +1,36 @@ +$prefix="s03e" +$suffix=".mp4" + +$titles = @( +"Introduction Learning Goals Objectives", +"Introduction to Entrepreneurship", +"The Entrepreneur", +"Opportunity Organization Resources and Environment in the Entrepreneurship Process", +"The Start-up Process and Business Plan") + +$urls_lect = @( +"https://tube.tugraz.at/portal/watch/3000b644-e5d4-4c48-ba3b-f34ef60cc701", #section 0 +"https://tube.tugraz.at/portal/watch/81aa3b0e-57fe-4aff-91b2-3eb34e03d064", #section 1 +"https://tube.tugraz.at/portal/watch/0793a983-a7f5-4209-a943-336c9e4cea68", #section 2 +"https://tube.tugraz.at/portal/watch/238c3479-54a2-42d7-a05c-6fd8d2fc5757", #section 3 +"https://tube.tugraz.at/portal/watch/52ecdb57-7713-42cd-b036-fa5a03cd35eb" #section 4 +) + +$urls_exec = @( +"", # no exec for section 0 +"https://tube.tugraz.at/portal/watch/5e7b4f75-d52d-41a7-b315-82c4515a5838", #section 1 +"https://tube.tugraz.at/portal/watch/f82b6152-a226-4026-8249-5a64db9e2bec", #section 2 +"https://tube.tugraz.at/portal/watch/a9a91ed8-ddda-4bc1-af98-72d2fd1a8769", #section 3 +"https://tube.tugraz.at/portal/watch/02defa69-68e9-4713-8b14-011f4a31195d" #section 4 +) + +for( $pos=0 ; $pos -lt $urls_lect.Count ; $pos++) +{ + # Build filename + $fn_lect = $prefix + "0" + $pos + "-" + $($titles[$pos].tolower().replace(" ","_").replace("-","_")) + $suffix + $fn_exec = $prefix + "0" + $pos + "-" + $($titles[$pos].tolower().replace(" ","_").replace("-","_")) + "_exercise" + $suffix + + yt-dlp -o "~\Downloads\$fn_lect" $($urls_lect[$pos]) + + yt-dlp -o "~\Downloads\$fn_exec" $($urls_exec[$pos]) +} \ No newline at end of file diff --git a/windows/Disable-FolderTypeDiscovery.ps1 b/windows/Disable-FolderTypeDiscovery.ps1 new file mode 100644 index 0000000..d2b4799 --- /dev/null +++ b/windows/Disable-FolderTypeDiscovery.ps1 @@ -0,0 +1,23 @@ +# Registry Path +$RegKey_FolderDiscovery = "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell" + +# Delete the Bags and BagMRU keys if they exist +Remove-Item -Path "$RegKey_FolderDiscovery\Bags" -Recurse -Force -ErrorAction SilentlyContinue +Remove-Item -Path "$RegKey_FolderDiscovery\BagMRU" -Recurse -Force -ErrorAction SilentlyContinue + +# Create the Bags key +New-Item -Path $RegKey_FolderDiscovery -Name "Bags" -Force + +# Create the AllFolders key inside Bags +New-Item -Path "$RegKey_FolderDiscovery\Bags" -Name "AllFolders" -Force + +# Create the Shell key inside AllFolders +New-Item -Path "$RegKey_FolderDiscovery\Bags\AllFolders" -Name "Shell" -Force + +# Create the FolderType string value and set its data to NotSpecified +New-ItemProperty -Path "$RegKey_FolderDiscovery\Bags\AllFolders\Shell" -Name "FolderType" -PropertyType String -Value "NotSpecified" -Force + +Write-Output "Folder discovery has been disabled. Restarting File Explorer to see the changes." + +Stop-Process -Name explorer -Force +Start-Process -FilePath "C:\Windows\explorer.exe" \ No newline at end of file diff --git a/windows/Set-FullContextMenu.ps1 b/windows/Set-FullContextMenu.ps1 new file mode 100644 index 0000000..f7b6532 --- /dev/null +++ b/windows/Set-FullContextMenu.ps1 @@ -0,0 +1,38 @@ +[CmdletBinding()] +param ( + [Parameter()] + [switch] + $Disable +) + +# GUID and Registry Path +$guid = "{86CA1AA0-34AA-4E8B-A509-50C905BAE2A2}" +$RegPath_ContextMenu = "HKCU:\Software\Classes\CLSID\" +$FullContextMenuStatus = "disabled" + +function EnableFullContextMenu { + # Create the GUID key + New-Item -Path $RegPath_ContextMenu -Name $guid -Force | Out-Null + + # Create the InprocServer32 key + New-Item -Path $RegPath_ContextMenu$guid -Name InprocServer32 -Value "" -Force | Out-Null +} + +function DisableFullContextMenu { + # Delete the Context Menu overrides + Remove-Item -Path $RegPath_ContextMenu -Recurse -Force -ErrorAction SilentlyContinue +} + +if ($Disable) { + DisableFullContextMenu + $FullContextMenuStatus = "disabled" +} +else { + EnableFullContextMenu + $FullContextMenuStatus = "enabled" +} + +Write-Output "Full Context Menu has been $FullContextMenuStatus. Restarting File Explorer to see the changes..." + +Stop-Process -Name explorer -Force +Start-Process -FilePath "C:\Windows\explorer.exe" \ No newline at end of file