|
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim foundFile As String
foundFile = "c:\freejoin1.exe"
If Not IO.File.Exists(foundFile) Then
'파일이 없으면 찾는다.
foundFile = Nothing
For Each foundFile In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.SpecialDirectories.ProgramFiles, FileIO.SearchOption.SearchAllSubDirectories, "freejoin1.exe")
Next
End If
If foundFile Is Nothing Then Exit Sub
Dim filePath As String = My.Computer.FileSystem.GetFileInfo(foundFile).DirectoryName
Dim xExeFile As String = My.Computer.FileSystem.GetFileInfo(foundFile).FullName
Dim xfile As String = "D:\10_작업문서\10_개발문서\01_공통관리문서\65_업무관리사항.ppt"
'프로세스 실행
Process.Start(xExeFile, xfile)
' 프로세스 id 로 실행
'Dim pID As Integer = Shell(xfile, AppWinStyle.NormalFocus)
''AppActivate(pID)
End Sub
End Class
xp에서는 파일을 찾아서 실행을 시키는데요..
xp가 아닌 윈도우 7은 안되요 ㅠ.ㅠ 에러문구가 뜨넹요~
For Each foundFile In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.SpecialDirectories.ProgramFiles, FileIO.SearchOption.SearchAllSubDirectories, "freejoin1.exe")
이부분에서 엑서스가 거부되었다고 하네요..
|