Create folder shortcut in C #

0

Talk, I'm trying to create a shortcut to a folder using the WshShell library. Unfortunately when I create the shortcut it is displaying the destination type as File. Photo of the destination type that is showing up. I needed the destination type to be Folder of files. Photo of the type of destination I need.

Follow the code I'm using to create the shortcut

WshShell wsh = new WshShell();
IWshRuntimeLibrary.IWshShortcut shortcut = wsh.CreateShortcut(
Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\pasta.lnk");
shortcut.TargetPath = AppDomain.CurrentDomain.BaseDirectory + "/pasta";
shortcut.WindowStyle = 1;
shortcut.Description = "Arquivos identificados pelo drive";
shortcut.Save();

The question is, how do I set up shortcut creation for a folder in C #?

Thank you.

    
asked by anonymous 17.06.2018 / 20:50

0 answers