470,626 Members | 2,245 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,626 developers. It's quick & easy.

System.Diagnostics.Process.Start

Can any one help? I'm trying to use System.Diagnostics.Process.Start to open
legacy MS access aplications (ade and mdb files) and vb 6 .exe's using
asp.net. There is something confusing going on?!?
The files are all in the same network location, when I try and start the
MSaccess files I get a "file not found" error (it does go as far as opening
Msaccess, but doesn't load the DB), when I try to start the exe, the .exe is
found and runs, but the ini file is not found (you have to browse to it on
the local machine) then the SQL connection fails because its trying to log on
as the local machine name. All the files have inherited information from the
parent folder so are identical. This is the code I'm using:

Dim ProcessStartInfo As New System.Diagnostics.ProcessStartInfo
ProcessStartInfo.FileName = stb.ToString
ProcessStartInfo.WorkingDirectory = [local dir]
ProcessStartInfo.WindowStyle = ProcessStartInfo.WindowStyle.Maximized
ProcessStartInfo.UseShellExecute = True
ProcessStartInfo.CreateNoWindow = False
System.Diagnostics.Process.Start(ProcessStartInfo)

I've tried it with and without:

'Dim impersonationContext As
System.Security.Principal.WindowsImpersonationCont ext
'Dim currentWindowsIdentity As
System.Security.Principal.WindowsIdentity
'currentWindowsIdentity = CType(User.Identity,
System.Security.Principal.WindowsIdentity)
'impersonationContext = currentWindowsIdentity.Impersonate()

and my machine config is set up as this:

<identity impersonate="true" userName="domain\administrator"
password="password"/>
<processModel userName="machine" password="autogenerate" />

have also tried:

<processModel userName="system" password="autogenerate" />

Someone please help.....

Jul 21 '05 #1
5 13937
Toby,

Did you already try it this way.
(Typed here so watch typos)
\\\
Dim ProcessStartInfo As New Process
ProcessStartInfo.FileName = stb.ToString
ProcessStartInfo.WorkingDirectory = [local dir]
ProcessStartInfo.WindowStyle = WindowStyle.Maximized
Process.StartInfo.Arguments = "whatever"
ProcessStartInfo.UseShellExecute = True
ProcessStartInfo.CreateNoWindow = False
ProcessStartInfo.Start
///
I hope this helps?

Cor
Jul 21 '05 #2
Yep, have tried that. gives the same result :( The problem doesn't seem to be
with the vb code itself but the way asp authenticates.

Thanks, anyhow tho......

"Cor Ligthert" wrote:
Toby,

Did you already try it this way.
(Typed here so watch typos)
\\\
Dim ProcessStartInfo As New Process
ProcessStartInfo.FileName = stb.ToString
ProcessStartInfo.WorkingDirectory = [local dir]
ProcessStartInfo.WindowStyle = WindowStyle.Maximized
Process.StartInfo.Arguments = "whatever"
ProcessStartInfo.UseShellExecute = True
ProcessStartInfo.CreateNoWindow = False
ProcessStartInfo.Start
///
I hope this helps?

Cor

Jul 21 '05 #3
Toby,

I did nowhere read in your question that this was in an ASP application. Is
it an ASP application? And when it is maybe can you than next time give that
information, can save a lot of time for the ones who want to help you.

Cor
"toby" <to**@discussions.microsoft.com>
Yep, have tried that. gives the same result :( The problem doesn't seem to
be
with the vb code itself but the way asp authenticates.

Thanks, anyhow tho......

"Cor Ligthert" wrote:
Toby,

Did you already try it this way.
(Typed here so watch typos)
\\\
Dim ProcessStartInfo As New Process
ProcessStartInfo.FileName = stb.ToString
ProcessStartInfo.WorkingDirectory = [local dir]
ProcessStartInfo.WindowStyle = WindowStyle.Maximized
Process.StartInfo.Arguments = "whatever"
ProcessStartInfo.UseShellExecute = True
ProcessStartInfo.CreateNoWindow = False
ProcessStartInfo.Start
///
I hope this helps?

Cor

Jul 21 '05 #4
You can't do this (kind of).
When doing this from asp.net with userName="machine" or
userName="system", your exe will run as "aspnet" or "LOCALSYSTEM"
respectively (both are local accounts). In this case, the credentials used
on the network is the "machine account" .
If you run in a W2K Active Directory domain, you can grant access rights to
this machine account, else you have to set userName to a domain acount that
has access privileges to your DB.

Willy.

"toby" <to**@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Can any one help? I'm trying to use System.Diagnostics.Process.Start to
open
legacy MS access aplications (ade and mdb files) and vb 6 .exe's using
asp.net. There is something confusing going on?!?
The files are all in the same network location, when I try and start the
MSaccess files I get a "file not found" error (it does go as far as
opening
Msaccess, but doesn't load the DB), when I try to start the exe, the .exe
is
found and runs, but the ini file is not found (you have to browse to it on
the local machine) then the SQL connection fails because its trying to log
on
as the local machine name. All the files have inherited information from
the
parent folder so are identical. This is the code I'm using:

Dim ProcessStartInfo As New System.Diagnostics.ProcessStartInfo
ProcessStartInfo.FileName = stb.ToString
ProcessStartInfo.WorkingDirectory = [local dir]
ProcessStartInfo.WindowStyle =
ProcessStartInfo.WindowStyle.Maximized
ProcessStartInfo.UseShellExecute = True
ProcessStartInfo.CreateNoWindow = False
System.Diagnostics.Process.Start(ProcessStartInfo)

I've tried it with and without:

'Dim impersonationContext As
System.Security.Principal.WindowsImpersonationCont ext
'Dim currentWindowsIdentity As
System.Security.Principal.WindowsIdentity
'currentWindowsIdentity = CType(User.Identity,
System.Security.Principal.WindowsIdentity)
'impersonationContext = currentWindowsIdentity.Impersonate()

and my machine config is set up as this:

<identity impersonate="true" userName="domain\administrator"
password="password"/>
<processModel userName="machine" password="autogenerate" />

have also tried:

<processModel userName="system" password="autogenerate" />

Someone please help.....

Jul 21 '05 #5
Tobby,

I see now that I could have seen that you are using ASPNET because you are
using machine.config.

However maybe it is better when you tell that next time direct.

I do not assume that you want to start a windows UI application on the
server, while it is on the client AFAIK impossible (or should be impossible)

Cor
"Cor Ligthert" <no************@planet.nl>

I did nowhere read in your question that this was in an ASP application.
Is it an ASP application? And when it is maybe can you than next time give
that information, can save a lot of time for the ones who want to help
you.

Cor
"toby" <to**@discussions.microsoft.com>
Yep, have tried that. gives the same result :( The problem doesn't seem
to be
with the vb code itself but the way asp authenticates.

Thanks, anyhow tho......

"Cor Ligthert" wrote:
Toby,

Did you already try it this way.
(Typed here so watch typos)
\\\
Dim ProcessStartInfo As New Process
ProcessStartInfo.FileName = stb.ToString
ProcessStartInfo.WorkingDirectory = [local dir]
ProcessStartInfo.WindowStyle = WindowStyle.Maximized
Process.StartInfo.Arguments = "whatever"
ProcessStartInfo.UseShellExecute = True
ProcessStartInfo.CreateNoWindow = False
ProcessStartInfo.Start
///
I hope this helps?

Cor


Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by solex | last post: by
reply views Thread by Colin Williams | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.