473,770 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with CreateDirectory at service mode

My app run at 2 modes: Windows and Service. At Windows mode, my app works fine but at service mode, I can not use CreateDirectory command to create a new directory on server.
Ex:
Directory.Creat eDirectory(@"\\ ghpvn-linux1\ghp\2004 1205");

ghpvn-linux1: is the server name
ghp: is the shared directory
20041205: is the directory that I want to create

I receive error, starting "Could not find part of the path '\\ghpvn-linux1\ghp'."
I try to use both NetworkService account and LocalSystem account but still not success....
I have all the necessary permissions on shared directory of server
Can anybody help please?
Thanks,
Van Nguyen

--
Message posted via http://www.dotnetmonster.com
Nov 16 '05 #1
5 2619
it soud slike it is either a permissions issue for the account under which
the service is running or the fact that a
services run under a differnent directory from the installation directory it
usually runs from the "\windows\syste m32"

HTH

Ollie Riches

"Van Nguyen via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote in
message news:2f******** *************** *******@DotNetM onster.com...
My app run at 2 modes: Windows and Service. At Windows mode, my app works fine but at service mode, I can not use CreateDirectory command to create a
new directory on server. Ex:
Directory.Creat eDirectory(@"\\ ghpvn-linux1\ghp\2004 1205");

ghpvn-linux1: is the server name
ghp: is the shared directory
20041205: is the directory that I want to create

I receive error, starting "Could not find part of the path '\\ghpvn-linux1\ghp'." I try to use both NetworkService account and LocalSystem account but still not success.... I have all the necessary permissions on shared directory of server
Can anybody help please?
Thanks,
Van Nguyen

--
Message posted via http://www.dotnetmonster.com

Nov 16 '05 #2
What do you mean with "I have all the necessary permissions on shared
directory of server"?
NetworkService and LocalService are local accounts, they use the "machine
account" for network access (only usable in an AD domain), how can they have
access right at a remote server?
You need to run your service with a domain account having access to the
remote server.

Willy.
"Van Nguyen via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote in
message news:2f******** *************** *******@DotNetM onster.com...
My app run at 2 modes: Windows and Service. At Windows mode, my app works
fine but at service mode, I can not use CreateDirectory command to create
a new directory on server.
Ex:
Directory.Creat eDirectory(@"\\ ghpvn-linux1\ghp\2004 1205");

ghpvn-linux1: is the server name
ghp: is the shared directory
20041205: is the directory that I want to create

I receive error, starting "Could not find part of the path
'\\ghpvn-linux1\ghp'."
I try to use both NetworkService account and LocalSystem account but still
not success....
I have all the necessary permissions on shared directory of server
Can anybody help please?
Thanks,
Van Nguyen

--
Message posted via http://www.dotnetmonster.com

Nov 16 '05 #3
First, thank for your answer.
I have new some problems. My server is linux server. So, with full control permissions on shared directory of linux server(drwxrwxr wx), my app only can create subdirectory with "nobody" account(default account for guest) on shared directory of linux server at service mode. In C#, how to access to shared directory of linux server with another acount(using username and password), such as samba account?

--
Message posted via http://www.dotnetmonster.com
Nov 16 '05 #4

"Van Nguyen via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote in
message news:0c******** *************** *******@DotNetM onster.com...
First, thank for your answer.
I have new some problems. My server is linux server. So, with full control
permissions on shared directory of linux server(drwxrwxr wx), my app only
can create subdirectory with "nobody" account(default account for guest)
on shared directory of linux server at service mode. In C#, how to access
to shared directory of linux server with another acount(using username and
password), such as samba account?


Use the credentials of your windows account to run your service.
Willy.

Nov 16 '05 #5
thanks you so much
I fixed my errors....

--
Message posted via http://www.dotnetmonster.com
Nov 16 '05 #6

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

Similar topics

32
4540
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with the content (MIME) type specified as text/html (http://keystonewebsites.com/articles/mime_type.php). These pages are then loaded on to their Server where they are served to Rendering Agents (browsers) as HTML (SGML application) documents with no...
1
2426
by: Daniel | last post by:
If I call CreateDirectory(\\\\devDriveA\\foo\\bar\\a\\b\\c) and \\devDriveA\foo\bar already exists then sub directories a\b\c don't get created. When I use CreateDirectory on my own file system, e.g. CreateDirectory("c:\\a\\b\\c"); it works fine. Is there something that I must do to get CreateDirectory to work on network drives?
1
1539
by: H.B. | last post by:
Hi, Is there a way to avoid conflicts between CreateDirectory() (from API) and Directory::CreateDirectory(). The other functions from Directory class works(Exists() as example). It seems to be caused by the inclusion of "windows.h" ... but I need it. I already tried the System::IO::Directory::CreateDirectory() typo. Any ideas ?
0
3227
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs converted/developed with VB.NET. What I want from debugging is to be able to step into the methods in the DLLs called from ASP scripts using Visual Studio .NET. Background: For typical script debugging issues, you can read and follow the two documents on...
9
13753
by: Clinton Frankland | last post by:
Hi, On a Windows 2000 Server when attempting to use System.IO.Directory.CreateDirectory(string.concat(Server.MapPath(""), "\verify")) I receive a System.IO.DirectoryNotFoundException error: Could not find a part of the path "D:\". The full path is "D:\hshome\clinton\test.gotchasoft.com\verify" The web is running using impersonation as a user on the local machine.
5
1980
by: Dan Lorenz | last post by:
When trying to use the function CreateDirectory on my local machine everything works fine but when I upload the page to my webhost I get an issue that it can't find path on D:\, though D:\ is what my website is found on. This is an H-SPHERE web cluster host. From my research I found that this issue is due to ASPNET account not having read previdgeles on the root of the drive. My question is what is the correct approach to solve this...
2
8694
by: Toolsmith | last post by:
The following code: C# code: Directory.CreateDirectory("D:\\somewhere\\somewhereelse\\here\\") works, but the following does flags the error: An unhandled exception of type 'System.NotSupportedException' occurred in mscorlib.dll
4
2997
by: Ken | last post by:
I'm currently working on framework 1.1 webapplication using C#. When I test the application located in my local machine, it works fine to "Directory.CreateDirectory()". However, I test the application use in server machine, it doesn't work. it make security log like below. Anyone has a idea for this???? Thanks ======================
4
2573
by: Tom | last post by:
This is really weird, but I have the following code: private static readonly string mString = "tempUnzipDir" + Path.DirectorySeparatorChar; .... public static string ExtractToTempLocation(string aZip) { try
0
9619
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
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
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...
0
8933
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
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
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2850
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.