473,385 Members | 1,325 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,385 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 14078
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.