Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add or remove Item Windows Explorer Quick Access
#1
Is there a qm way to deal with windows explorer quick access?
I found a powershell script for that, but qm would be more convenient.
https://gallery.technet.microsoft.com/sc...s-117e9a89
pi
#2
Maybe this one can be used
https://stackoverflow.com/a/50032421

You need to add a reference to "Microsoft Shell Controls and Automation".

This will add a link

Type shellAppType = Type.GetTypeFromProgID("Shell.Application");
Object shell = Activator.CreateInstance(shellAppType);
Shell32.Folder2 f = (Shell32.Folder2)shellAppType.InvokeMember("NameSpace", System.Reflection.BindingFlags.InvokeMethod, null, shell, new object[] { "C:\\temp" });
f.Self.InvokeVerb("pintohome");

This will remove a link by name

Type shellAppType = Type.GetTypeFromProgID("Shell.Application");
Object shell = Activator.CreateInstance(shellAppType);
Shell32.Folder2 f2 = (Shell32.Folder2)shellAppType.InvokeMember("NameSpace", System.Reflection.BindingFlags.InvokeMethod, null, shell, new object[] { "shell:::{679f85cb-0220-4080-b29b-5540cc05aab6}" });
Console.WriteLine("item count: " + f2.Items().Count);
foreach (FolderItem fi in f2.Items())
{
Console.WriteLine(fi.Name);
if (fi.Name == "temp")
{
((FolderItem)fi).InvokeVerb("unpinfromhome");
}
}

thanks
pi
#3
C# code can be executed in QM.
Or can be converted to QM:

Macro Macro79
Code:
Copy      Help
Shell32.Shell shell._create
Shell32.Folder2 f=+shell.NameSpace("Q:\Test\a")
f.Self.InvokeVerb("pintohome")

mes "unpin"

Shell32.Folder2 f2=+shell.NameSpace("shell:::{679f85cb-0220-4080-b29b-5540cc05aab6}")
out F"item count: {f2.Items.Count}"
Shell32.FolderItem fi
foreach fi f2.Items
,out fi.Name
,sel fi.Name 1
,,case "a"
,,fi.InvokeVerb("unpinfromhome")
,,break
#4
Thanks!
pi


Forum Jump:


Users browsing this thread: 2 Guest(s)