Guest User

Untitled

a guest
Feb 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Private Sub LaunchOutlookFromCmd(ByVal UserName As String, ByVal SecurePassword As SecureString, ByVal Domain As String)
  2.  
  3. Try
  4.  
  5. Dim PSI As New ProcessStartInfo
  6. Dim path As String = GetOutlookPath()
  7. Dim cmd As String = " /C runas /user:" + UserName + " """ + path & My.Settings.OutlookAppExe + " /importprf path:\comp.ussysvolcomp.usSoftwareOutlook2010comp.prf"""
  8. PSI.WorkingDirectory = IO.Path.GetPathRoot(path)
  9. PSI.FileName = "cmd.exe"
  10.  
  11. Console.WriteLine("Cmd Args = " + cmd)
  12. PSI.Arguments = cmd
  13. PSI.LoadUserProfile = True
  14. PSI.WindowStyle = ProcessWindowStyle.Normal
  15.  
  16. OutlookProc = New Process()
  17. OutlookProc.StartInfo = PSI
  18. OutlookProc.Start()
  19.  
  20. Catch ex As Exception
  21. End Try
  22. End Sub
Add Comment
Please, Sign In to add comment