CoachBarker
Well-known member
- Joined
- Jul 26, 2007
- Messages
- 133
- Programming Experience
- 1-3
We have come up with this to Launch and run the VPN and it works on the desktops at work with no problems
But when I run it on my laptop at home to test the application off the domain I get this error
ErrorSystem.ComponentModel.Win32Exception: The system cannot find the file Specified
At System.Diagnostics.Process.StartWithShellExecuteEx (ProcessStartInfo startInfo)
At System.Diagnostics.Process.Start( )
At System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
At System.Diagnostics.Process.Start(String fileName)
At BalantineProject3.frmMain.RunProg( ) in C:\Documents and Settings\barker44\Destop\Whitman Remote Desktop\BalantineProject3\Forms\frmMain,vb:ine 303
But if I run it this way on my laptop it works
Somehow we need to change it so the path is set to All Users and not Barker44. Does anyone have any suggestions?
Thanks once again
CoachBarker
VB.NET:
Private Sub RunProg()
Try
Dim prc As New Process
Dim desktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
MsgBox(desktopPath)
prc = Process.Start(desktopPath & "Shortcut to Syracuse University VPN.lnk")
'Alt+Tab to make the VPN window appear on top
Windows.Forms.SendKeys.Send("%")
Windows.Forms.SendKeys.Send("{TAB}")
Catch ex As Exception
'MessageBox.Show("An error occured in frmMain Method: RunProg(). Error: " & ex.Message)
MsgBox("Error" & ex.ToString)
End Try
End Sub
But when I run it on my laptop at home to test the application off the domain I get this error
ErrorSystem.ComponentModel.Win32Exception: The system cannot find the file Specified
At System.Diagnostics.Process.StartWithShellExecuteEx (ProcessStartInfo startInfo)
At System.Diagnostics.Process.Start( )
At System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
At System.Diagnostics.Process.Start(String fileName)
At BalantineProject3.frmMain.RunProg( ) in C:\Documents and Settings\barker44\Destop\Whitman Remote Desktop\BalantineProject3\Forms\frmMain,vb:ine 303
But if I run it this way on my laptop it works
VB.NET:
Private Sub RunProg()
Try
Dim prc As New Process
prc = Process.Start("C:\Documents and Settings\All Users\Desktop\Shortcut to Syracuse University VPN.lnk")
'Alt+Tab to make the VPN window appear on top
Windows.Forms.SendKeys.Send("%")
Windows.Forms.SendKeys.Send("{TAB}")
Catch ex As Exception
'MessageBox.Show("An error occured in frmMain Method: RunProg(). Error: " & ex.Message)
MsgBox("Error" & ex.ToString)
End Try
End Sub
Somehow we need to change it so the path is set to All Users and not Barker44. Does anyone have any suggestions?
Thanks once again
CoachBarker