473,756 Members | 5,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem shelling to local console app from production server

On my development machine (where the group 'Everyone' has full access
to every directory), the following code successfully shells to a
console application:

Dim objShell As System.Diagnost ics.Process = New
System.Diagnost ics.Process()
With objShell
.StartInfo.File Name = "C:\Project\MyA pp\MyApp.exe"
.StartInfo.Argu ments = " 123"
.StartInfo.Work ingDirectory = "C:\Project\MyA pp\"
.StartInfo.Crea teNoWindow = True
.StartInfo.UseS hellExecute = False
.Start()
End With

When I transfer my ASP.Net project to the production server, the
console application starts (ie 'MyApp.exe' appears in Windows Task
Manager), but then hangs.

Using System.Security .Principal.Wind owsIdentity.Get Current().Name( ) I
have checked that the ASP.Net application is running under the context
of MACHINE\ASPNET and I have given this user full access to the
directory "C:\Project\MyA pp\" and execute permissions to
"C:\Project\MyA pp\MyApp.exe".

I don't think the console app is throwing an error as the program with
arguments runs fine from the command prompt and the development
server. I have experimented with a simple console application that
simply writes to a log file in the working directory, however this
fails to executes, suggesting that the program has insufficient
read/write access to the working directory.

I suspect that the System.Diagnost ics.Process requires read/write
access to a directory or process other then those given in the
FileName and WorkingDirector y properties. Can anyone help?

Both the Development and Production servers are running Win2K
5.00.2195 & .Net 1.1

Thanks,

Stephen
Nov 18 '05 #1
1 1927
> On my development machine (where the group 'Everyone' has full access
to every directory), the following code successfully shells to a
console application:

Dim objShell As System.Diagnost ics.Process = New
System.Diagnost ics.Process()
With objShell
.StartInfo.File Name = "C:\Project\MyA pp\MyApp.exe"
.StartInfo.Argu ments = " 123"
.StartInfo.Work ingDirectory = "C:\Project\MyA pp\"
.StartInfo.Crea teNoWindow = True
.StartInfo.UseS hellExecute = False
.Start()
End With

When I transfer my ASP.Net project to the production server, the
console application starts (ie 'MyApp.exe' appears in Windows Task
Manager), but then hangs.

Using System.Security .Principal.Wind owsIdentity.Get Current().Name( ) I
have checked that the ASP.Net application is running under the context
of MACHINE\ASPNET and I have given this user full access to the
directory "C:\Project\MyA pp\" and execute permissions to
"C:\Project\MyA pp\MyApp.exe".

I don't think the console app is throwing an error as the program with
arguments runs fine from the command prompt and the development
server. I have experimented with a simple console application that
simply writes to a log file in the working directory, however this
fails to executes, suggesting that the program has insufficient
read/write access to the working directory.

I suspect that the System.Diagnost ics.Process requires read/write
access to a directory or process other then those given in the
FileName and WorkingDirector y properties. Can anyone help?

Both the Development and Production servers are running Win2K
5.00.2195 & .Net 1.1

Thanks,

Stephen


.... I'll answer my own question, because it might help other users.

When objShell.StartI nfo.UseShellExe cute was set to 'True', the server
console was displaying the error message "The application failed to
initialise properly (0xc0000022)", with each attempt at shelling
MyApp.exe from ASP.Net (I was using terminal services, so I wasn't
seeing the message). Searching for this error led me think that
MyApp.exe was attempting to call a DLL, for which the user
MACHINE\ASPNET did not have any execute privileges.

MyApp.exe was written in VB6 and using Visual Studio 6's 'Depends.exe'
(find it at '..\Microsoft Visual Studio\Common\T ools\') on the
production server I was able to determine that MACHINE\ASPNET did not
have execute privileges on the 'msvbvm60.dll'. I added permissions and
the ASP.Net was able to shell my program.

Stephen
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2349
by: Steven Fox | last post by:
============================================================ About DB2 Administration Tools Environment ============================================================ DB2 administration tools level: Product identifier SQL08015 Level identifier 02060106 Level DB2 v8.1.5.449 Build level s040212 PTF WR21334...
8
3397
by: nick | last post by:
I have a problem and I've been using a cheezy work around and was wondering if anyone else out there has a better solution. The problem: Let's say I have a web application appA. Locally, I set it up as C:\domains\appA. Locally, my IIS root points to C:\domains. I don't point it to C:\domains\appA since if I have an appB under C:\domains I wouldn't be able to get to it. So to access it via my browser I go to localhost/appA.
15
2412
by: Ron L | last post by:
We are working on a distributed VB.Net application which will access a SQL database located on a known server. Each client will run on the user's local machine. To implement this, we are trying to use remoting for our access to the SQL server, with the remoting being via IIS. Since all of our users will have accounts in the destination domain, we want to have IIS handle the security for us and not allow anonymous. We have set this up...
7
7010
by: WALDO | last post by:
I wrote a console application that basically consumes arguments and starts other command line apps via System.Process. Let's call it XCompile for now. I wrote a Visual basic add-in that does pretty much the same thing to XCompile. Let's call it MyAddin. XCompile collects information to send to vbc.exe. When it comes across any arguments that are file paths, it wraps them in quotes. For example: Dim prms As String
15
1572
by: matko | last post by:
Hi! In one of the two examples for the PaintEventArgs.Graphics-property (in the VS 2005 documentation), the Graphics-object is "saved" to a local variable, before being used. In the other example, no such saving is done. Why was the Graphics-object saved in one of the examples? Is that really necessary? Example #1:
4
5691
by: shashank kadge | last post by:
hi all, i am trying to get local admin users and groups on a windows server. here is the C# code that i am using *************************************************************************************************** DirectoryEntry AD = new DirectoryEntry("WinNT://" + sServerName + ",Computer",UserName,Password); DirectoryEntry admGroup = AD.Children.Find("Administrators", "Group"); object members = admGroup.Invoke("Members", null); ...
2
1638
by: smtwtfs007 | last post by:
Guys, I am having problems with Excel 2000 to Excel 2003 dll in production. I am having version 2003 in my PC and I used the below code change to open password protected excel files in my application. My application is in ASP.NET From: objExcel = New Excel.Application
0
1705
by: smtwtfs007 | last post by:
Guys, I am having problems with Excel 2000 to Excel 2003 dll in production. I am having version 2003 in my PC and I used the below code change to open password protected excel files in my application. My application is in ASP.NET From: objExcel = New Excel.Application
1
2138
by: Adrienne Boswell | last post by:
This is the strangest thing. On my local beta server (WinXP Pro SP3, PHP 5.2.3), I am getting an unexpected $end. On the production server, I am not. The files are identical. Just for shits and giggles, I made a new folder on my local machine, copied all the files from the production server, opened it, and again got the same thing. The production server is running version 4.4.7. So I thought, aha! - older version of PHP. So I opened...
0
9454
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10028
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9707
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6533
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3804
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3352
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2664
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.