473,406 Members | 2,619 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,406 software developers and data experts.

GetEnvironmentVariable and IIS 6.0

I had an ASPNET application keeping files into the LocalApplicationData
folder of the ASPNET account in IIS 5.0 which worked perfectly, but it
doesn't workon IIS 6.0 (windows server 2003). I rely on the function
Environment.GetFolderPath to get this path, and for the Network Service
account, this function returns an empty string, though a directory named
C:\Documents and Settings\NetworkService exists.

I then tried to use Environment.GetEnvironmentVariable to get the
USERPROFILE environment variable, and it returns C:\Documents and
Settings\LocalService (and NOT C:\Documents and Settings\NetworkService as
would be expected since the it is the network service account that runs
w3wp.exe !!!). Of course, the Network Service account cannot write in this
directory, since it's not its profile directory.

I don't understand why Network Service doesn't return correct special
folders, and I don't understand why its USERPROFILE environment variable is
set to the one of Local Service. If anybody has a clue...

NB : all these functions return correctly on a Windows Server 2003 UPGRADED
from Windows Server 2000... Welcome to the twilight zone !!!

Regards

François
Nov 19 '05 #1
0 1357

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

Similar topics

4
by: AA | last post by:
Do you know how can i get that? Thanks a lot
0
by: Mike Burton | last post by:
Hi folks, We've got a VB6 app that needs to shell out to a .NET executable. The main VB6 app calls a plugin dll (also VB6) which simply uses Shell (or CreateProcessA, we've tried both) to start...
10
by: denis.greatest | last post by:
Hello folks, I was trying to set some environment variable for a process I create. (The variables are my own, not system). I use SetEnvironmentVaraible() from C# code. In Debug configuration...
3
by: serkan ulucan | last post by:
Hi, I want to add a video link on web form. Up on clicking this link what I want is that first downloading video automatically without asking where to download, then play the downloaded video. I...
9
by: Stephen Costanzo | last post by:
When I log onto my workstation, I select my system domain (KRUSTY -- can you tell we have simpson fans as networking??) and my user name, so when I look at the CTRL+ALT+DEL screen it is...
6
by: Nikolay Petrov | last post by:
the GetEnvironmentVariable method returns "Nothing" when used against a environment variable, created by me. I've tried using SET from the console, or "Environment Variables" in my computer...
3
by: Drwtsn32 | last post by:
Hi Guys, I'm ripping off all of my hair soon ;-) I'm trying to do a very simple C# form accessible from COM client like VBScript. I would like to display the form and update the form during...
2
by: fdmaxey | last post by:
I've written code in VB.Net that calls GetEnvironmentVariable. When I execuate the code as part of a Windows Form, it reads the environment variable with no problem. I put the code in a Windows...
0
by: Graham | last post by:
I'm trying to write a CGI script in C#; it receives data from an HTML form via the POST method, and tries to read the form data using System.Environment.GetEnvironmentVariable(). Which is where I...
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: 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...
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.