Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub LaunchOutlookFromCmd(ByVal UserName As String, ByVal SecurePassword As SecureString, ByVal Domain As String)
- Try
- Dim PSI As New ProcessStartInfo
- Dim path As String = GetOutlookPath()
- Dim cmd As String = " /C runas /user:" + UserName + " """ + path & My.Settings.OutlookAppExe + " /importprf path:\comp.ussysvolcomp.usSoftwareOutlook2010comp.prf"""
- PSI.WorkingDirectory = IO.Path.GetPathRoot(path)
- PSI.FileName = "cmd.exe"
- Console.WriteLine("Cmd Args = " + cmd)
- PSI.Arguments = cmd
- PSI.LoadUserProfile = True
- PSI.WindowStyle = ProcessWindowStyle.Normal
- OutlookProc = New Process()
- OutlookProc.StartInfo = PSI
- OutlookProc.Start()
- Catch ex As Exception
- End Try
- End Sub
Add Comment
Please, Sign In to add comment