473,379 Members | 1,201 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,379 software developers and data experts.

Error Spawning Process from ASP.NET

All,

I posted a message here recently regarding the difficulty
I'm having with CreateProcessWithLogonW() in an ASP.NET
application. I get the following Win32 error:

Error 183: Cannot create a file when that file already exists.

I thought it was Win2K3 or IIS6 giving me grief, but it
appears to behave the same way on a WinXP/IIS5 system.

I impersonated a domain admin and even wrote a small
test console app that is launched and logs the current
user info. This runs when spawned from another console
app (and has the correct new impersonation), but never
works from the ASP.NET app.

Is this kind of thing not permitted, no matter what
rights the user may have? I'm almost tempted to
create a simple .NET Remoting setup to do this
(and turn the 2nd app into a remoting server --
singleton -- which could work fine), but that seems
like a silly way to go.

Any ideas? I can provide more info if needed.

Thanks!
bn

Nov 19 '05 #1
4 1199
Is the problem simply that the asp.net user only has read access to the Dir
when impersonated?

The asp.net account must have the rights to create the file, so it sounds
like your half way there as impersonation is usually the way to go.
However, you might want to use asp.net impersonation rather than
createprocesswithlogon and let the system worry about how the impersonation
works.

If you cant go this route, then ensaure everyone has file system access to
the dir you are creating in and tighten up from there once you have it
working.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

<ho**********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
All,

I posted a message here recently regarding the difficulty
I'm having with CreateProcessWithLogonW() in an ASP.NET
application. I get the following Win32 error:

Error 183: Cannot create a file when that file already exists.

I thought it was Win2K3 or IIS6 giving me grief, but it
appears to behave the same way on a WinXP/IIS5 system.

I impersonated a domain admin and even wrote a small
test console app that is launched and logs the current
user info. This runs when spawned from another console
app (and has the correct new impersonation), but never
works from the ASP.NET app.

Is this kind of thing not permitted, no matter what
rights the user may have? I'm almost tempted to
create a simple .NET Remoting setup to do this
(and turn the 2nd app into a remoting server --
singleton -- which could work fine), but that seems
like a silly way to go.

Any ideas? I can provide more info if needed.

Thanks!
bn

Nov 19 '05 #2
What exactly IS CreateProcessWithLogonW? It is not a method or property of
any classes in the CLR.

Pretend we don't know anything about your app. We don't.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

<ho**********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
All,

I posted a message here recently regarding the difficulty
I'm having with CreateProcessWithLogonW() in an ASP.NET
application. I get the following Win32 error:

Error 183: Cannot create a file when that file already exists.

I thought it was Win2K3 or IIS6 giving me grief, but it
appears to behave the same way on a WinXP/IIS5 system.

I impersonated a domain admin and even wrote a small
test console app that is launched and logs the current
user info. This runs when spawned from another console
app (and has the correct new impersonation), but never
works from the ASP.NET app.

Is this kind of thing not permitted, no matter what
rights the user may have? I'm almost tempted to
create a simple .NET Remoting setup to do this
(and turn the 2nd app into a remoting server --
singleton -- which could work fine), but that seems
like a silly way to go.

Any ideas? I can provide more info if needed.

Thanks!
bn

Nov 19 '05 #3

Kevin Spencer wrote:
What exactly IS CreateProcessWithLogonW? It is not a method or property of any classes in the CLR.

Pretend we don't know anything about your app. We don't.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.


It's a Win32 API function. It appeared to be
the best way to impersonate across process
boundaries.

bn

Nov 19 '05 #4
I would have to agree with John. Use the managed impersonation classes and
methods.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

<ho**********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...

Kevin Spencer wrote:
What exactly IS CreateProcessWithLogonW? It is not a method or

property of
any classes in the CLR.

Pretend we don't know anything about your app. We don't.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.


It's a Win32 API function. It appeared to be
the best way to impersonate across process
boundaries.

bn

Nov 19 '05 #5

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

Similar topics

2
by: Dave Kirby | last post by:
I am working on a network management program written in python that has multiple threads (typically 20+) spawning subprocesses which are used to communicate with other systems on the network. This...
1
by: Hervet | last post by:
Hi, I'm a newbie :o) Every time I try to compile , I get this message : Project : error PRJ0003 : Error spawning 'VCDeploy.exe'. Thanks in advance for your help Hervé -
3
by: ranjeet.gupta | last post by:
Hi All, Can any one help me out, by making me clear, Exactly what does the below error means. Compiling... Error spawning cl.exe Creating browse info file... Error spawning bscmake.exe
4
by: GeRmIc | last post by:
Hi, I was just shifted to a new domain on my network and all of a sudden the project i was working on gives an error - Error spawning "cl.exe". The project is actually a C DLL and a C# Library...
1
by: Russ Green | last post by:
I hav previosuly had VB.NET 2003 Standard installed on my machine and it works great. Yesterday I installed C++.NET 2003 Standard and starting playing with it. Hardly surprisingly it also worked...
1
by: Sanjay Kedare | last post by:
Hi, How safe it is to spawn a thread to do some routine job from Application_Start event of ASP.NET Also whenever the ASPNET worker process restarts, will the Application_Start event be...
7
by: kris_scheyer | last post by:
Hi, I have a little .exe file that I want the C# code behind of my web application to execute as a different user. The executable is supposed to take a screenshot of the server's display and...
5
by: Jeremy | last post by:
I have a core VB service that monitors a database, and based on data in the records will execute code to send email notifications. Problem: I don't want my main program code to halt and wait for...
12
by: bhunter | last post by:
Hi, I've used subprocess with 2.4 several times to execute a process, wait for it to finish, and then look at its output. Now I want to spawn the process separately, later check to see if it's...
1
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.