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

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.CreateDirectory(@"\\ghpvn-linux1\ghp\20041205");

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 2594
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\system32"

HTH

Ollie Riches

"Van Nguyen via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:2f******************************@DotNetMonste r.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.CreateDirectory(@"\\ghpvn-linux1\ghp\20041205");

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.com" <fo***@DotNetMonster.com> wrote in
message news:2f******************************@DotNetMonste r.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.CreateDirectory(@"\\ghpvn-linux1\ghp\20041205");

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(drwxrwxrwx), 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.com" <fo***@DotNetMonster.com> wrote in
message news:0c******************************@DotNetMonste r.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(drwxrwxrwx), 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
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...
1
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,...
1
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...
0
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...
9
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:...
5
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...
2
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...
4
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...
4
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.