728x90
반응형
728x170
1. 프로젝트 / 참조 메뉴를 클릭한다.
2. 참조 대화 상자에서 "Windows Script Host Object Model" 항목을 선택한다.
728x90
3. 아래 코드를 추가한다.
Dim pShell As IWshShell_Class
Dim pShortcut As IWshShortcut_Class
Dim strItemType As String
Dim strPath As String
Dim strFileName As String
Set pShell = New IWshShell_Class
strItemType = "Desktop"
'strItemType = "Program"
'strItemType = "MyDocuments"
'strItemType = "Favorites"
'strItemType = "Fonts"
'strItemType = "Recent"
'strItemType = "StartMenu"
'strItemType = "StartUp"
strPath = pShell.SpecialFolders.Item(strItemType)
strFileName = "test.lnk"
Set pShortcut = pShell.CreateShortcut(strPath & "\" & strFileName)
With pShortcut
.TargetPath = "c:\windows\notepad.exe"
.Description = "메모장"
.Arguments = "" ' 필요시 인자를 지정할 수 있다.
.WorkingDirectory = "c:\windows"
.WindowStyle = 1
.IconLocation = "c:\test.ico" ' 선택 항목이다.
.Save
End With
Set pShortcut = Nothing
Set pShell = Nothing
728x90
반응형
그리드형(광고전용)
'VB' 카테고리의 다른 글
[VB] SQL Server 연결 구하기 (윈도우즈 인증) (0) | 2015.05.16 |
---|---|
[VB] SQL Server 연결 구하기 (0) | 2015.05.16 |
[VB] UBOUND 함수를 사용해 배열 상한 인덱스 구하기 (0) | 2015.05.16 |
[VB] 법인등록번호 검증하기 (0) | 2015.05.16 |
[VB] 폼 배경에 바탕 화면 이미지 보여주기 (0) | 2015.05.16 |
[VB] 메시지 박스 일정 시간 경과 후 닫기 (0) | 2015.05.16 |
[VB] ComboBox 클래스 : 포커스 획득시 드롭 다운 리스트 자동으로 보여주기 (0) | 2015.05.16 |
[VB] 비프음 연주하기 (0) | 2015.05.16 |
[VB] CHR 함수 사용하기 (0) | 2015.05.16 |
[VB] JOIN 함수 사용하기 (0) | 2015.05.16 |
댓글을 달아 주세요