참조에 COM객체 “Windows Script Host Object Model”(1.0) 추가

 

   1: string fileName = @"Temp.lnk";
   2: string fileExt = Path.GetExtension(fileName);
   3: if (fileExt.Trim().ToLower() == ".lnk")
   4: {
   5:     IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell();
   6:     IWshRuntimeLibrary.IWshShortcut link = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(fileName);
   7:     fileName = link.TargetPath;
   8: }

출처 : 모름

+ Recent posts