473,320 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 14075
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Daniel Reber | last post by:
I am trying to start a process from a windows service but when the process starts the command window that the process runs in never shows. Is this because I am calling it from a windows service? ...
0
by: marccruz | last post by:
Given an instance of System.Diagnostics.Process, how can I get the parent process o Given an instance of System.Diagnostics.Process, how can I get the child processes For example, I start a...
1
by: solex | last post by:
Hello All, Hopefully someone has run into this error. I have written a class(source below) that launches a thread to monitor the StandardOutput of a System.Diagnostics.Process, in particular I...
2
by: andreas | last post by:
hi, In windows xp in the start launch menu when i put notepad "c:\test.txt" i get notepad with test.txt in it. in vb.net when i state system.diagnostics.process.start("notepad.exe" i get...
11
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very...
2
by: Daniel | last post by:
System.Diagnostics.Process.Start fails on windows server 2003 the process returns process.ExitCode == 0 but executing any process with System.Diagnostics.Process.Start on windows xp works fine....
0
by: Daniel | last post by:
C# windows service freezes on System.Diagnostics.Process.Start(info) When I launch PSCP from a C# windows service and launch pscp 0.53 there are no issues. but when I use C# windows service to...
0
by: Colin Williams | last post by:
I am using the code below to map network drive and then fire up an app in a sub dir of that drive. However when using the file open dialog from that app, drive K: appears just as Network drive K:...
2
by: test3 | last post by:
Hello folks, I'm using System.Diagnostics.Process to start a thirdparty program (that works perfectly when started via command line). I'm using Process.StandardOutput to get the output of the...
6
by: kimiraikkonen | last post by:
Hello, I want to ask this: If i do: System.Diagnostics.Process.Start("c:\lame", "--preset standard c:\blabla.wav c:\blabla.mp3") it works. But i don't want this. I want my 2 textboxes must...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.