
La papelera de reciclaje no aparece cuando la escribes en el menú de inicio, lo que parece increíblemente estúpido. Puedo crear un acceso directo y fijarlo en el menú Inicio para que aparezca, pero me gustaría automatizarlo para la próxima vez que instale Windows 10.
¿Hay alguna manera de automatizar esto usando PowerShell, Batch o VBS?
Lo intenté con PowerShell, pero dice acceso denegado. Incluso cuando se ejecuta como administrador.
$shell = New-Object -ComObject "Shell.Application"
$StartMenuProgramsFolder = [Environment]::GetFolderPath("StartMenu")
$folder = Join-Path -Path $StartMenuProgramsFolder -ChildPath "Programs"
$folder = $shell.Namespace($folder)
$item = $folder.Parsename("test.lnk")
$verb = $item.Verbs() | Where-Object {$_.Name -eq '&Pin to Start'}
if ($verb) {
$verb.DoIt()
}
Crear un acceso directo en la carpeta de accesos directos y reiniciar explorer.exe
tampoco lo fija automáticamente al menú de inicio.
Respuesta1
Este código funcionó para mí:
$objShell = New-Object -ComObject ("WScript.Shell")
$objShortCut = $objShell.CreateShortcut($env:USERPROFILE + "\Start Menu\Programs\" + "\Recycle Bin.lnk")
$objShortCut.TargetPath = "C:\Windows\Explorer.EXE"
$objShortCut.Arguments = "shell:RecycleBinFolder"
$objShortCut.IconLocation = "C:\PATH\recycle-bin.ico"
$objShortCut.WorkingDirectory = "C:\Windows\System32"
$objShortCut.Save()
Deberá buscar y utilizar encima un .ico
icono que le guste.