단축 아이콘, 바탕화면 바로가기의 경로 찾기
바탕화면에 있는 "WATclean 실행" 아이콘의 실제 경로를 찾는 방법입니다.
"WATclean 실행" 바로가기의 경로는 아래와 같습니다.
C:\Documents and Settings\사용자명\바탕 화면\WATclean 실행.lnk
using IWshRuntimeLibrary;
namespace WATShortCutInfo
{
    class Program
    {
        static void Main(string[] args)
        {
            string linkPathName = @"C:\Documents and Settings\사용자명\바탕 화면\WATclean 실행.lnk";
            WshShell shell = new WshShell();
            try
            {
                IWshShortcut link = (IWshShortcut)shell.CreateShortcut(linkPathName);
                Console.WriteLine("전체경로: {0}", link.TargetPath);
                Console.WriteLine("작업폴더: {0}", link.WorkingDirectory);
                Console.ReadLine();
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("예외 발생:",ex.Message);
}
        }
    }
}
IWshRuntimeLibrary 를 사용하려면
References 를 [Windows Script Host Object Model]을 추가해줘야 합니다.
[결과 창]
전체경로: C:\Program Files\WATclean\watclean.exe
작업폴더: C:\Program Files\WATclean

 
	
		 


 
    
 
    
 
     
 경로명으로 파일 리스트 가져오기
									경로명으로 파일 리스트 가져오기