Start process as different user

  • Thread starter Thread starter Armin Zingler
  • Start date Start date
A

Armin Zingler

Guest
Hi guys,

did I miss anything here? ;)

I'm starting Firefox as a different user with the following code:

Dim psi As New ProcessStartInfo()
Dim pwd As New Security.SecureString

'...

psi.FileName = path
psi.UserName = "bla"
psi.Password = pwd
psi.WorkingDirectory = "blub"
psi.UseShellExecute = False

Try
Process.Start(psi)
Catch ex As Exception
MessageBox.Show( _
"Es ist ein Fehler beim Starten von Firefox aufgetreten:" & Environment.NewLine & ex.Message, _
"RunFirefox", MessageBoxButtons.OK, MessageBoxIcon.Information _
)
End Try



That worked well.... yesterday. Today, a message is displayed that the "firefox profile could not be loaded". Strange, because I didn't change anything since yesterday. Process.Start does work. The error message comes from Firefox itself. It's referring to the firefox profile, not the Windows user profile. However, if I log into the other user account interactively, I can start Firefox without a problem.

BTW, starting FF using "runas" in the command line worked yesterday and still does today, so I'm wondering what is wrong in my code - the same code that worked yesterday but not today.

Anyone's got a clue what I'm missing?

Thanks


Armin

Continue reading...
 
Back
Top