473,800 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Service: Copy files from a shared folder

26 New Member
Hi,

I have a Windows Service that copies xml files from a shared folder on the server.

I am using System.IO.File. Copy(\\Server-Name\SharedDir) method. But whenever I try to copy files there is an error "Access is denied".

I tried the same code in Windows application and it worls fine. The problem is present only in the Windows Service.

Any suggestions?

Thanks
Nov 17 '09 #1
2 6040
Plater
7,872 Recognized Expert Expert
Change the user that your windows service runs under. By default its probably using a user that doesn't have access to the files.
Nov 17 '09 #2
sebouh181
26 New Member
Thanks :)

the problem is solved ;)
Nov 17 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
15230
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000 Personal disk from the SQL Server 2000 Enterprise kit as this is reported here on the MSDN web site to be the version that is supported on Windows XP. In fact so many of you kind people confess to having succeeded in doing it. I have tried...
1
6005
by: Vlad | last post by:
Is there any way to install multiple instances of the same windows service designed with VS.NET 2003? I tried copying the binaries into a separate folder and then copying registry entries for the original service under a new name but the SCM complains that the executable does not have this service implemented. Please note that I need to have distinct instances of executables installed not merely multiple windows services defined within...
2
2856
by: Stuart Ferguson | last post by:
Hi All, I am currently developing software for a Windows CE PC which i currently dont have the hardware, thus I am using the emulator for VS2003. The software writes out Timesheet entries to file on the WIndows CE PC which I have done but I require to get the files off the emulator to confirm the are correct. Is this possible with the Emulator or would I need the hardware for that ?
4
11743
by: sajid_yusuf | last post by:
Hi I am trying to develop a Windows service in VB.NET which has timer enabled and keeps checking a folder (or group of folders) for any new file or changed files. As soon as it detects any new file or changes (to files or folders) then it copies the files (and any new folders) to a folder in the mapped network drive. So far I have been successful in developing and deploying the service which works on my local machine with two drives...
4
3398
by: vovan | last post by:
I created Windows Service in VB 2005. Using InstallUtil.exe I register it on any machine with Windows XP, Windows 2003 Server without any problem. I even never had to learn that process. After registration I see a couple of new files in the folder where I have My Service EXE file (MSFaxListener.exe). Their names are MSFaxListener.InstallLog and MSFaxListener.InstallState. In the list of Services I see MSFaxListener service. I tried to...
4
1329
by: Blasting Cap | last post by:
I have an application that was converted from a VB application to a windows service. I pass in parameters in a file that tells the application where to pull a file from & read it and put it into a web page. The application works fine when the input & output locations are local on the server the app is on. However, the location for one of the files is going to change to be on another server, that'll have to be set up like...
3
5231
by: Benry | last post by:
Without having a reference to a specific folder, is there a way that Windows fires an event when files in a folder are modified? I'm using C++.NET 2.0 for programming a service, and would like this to be the starting point. I have a shared folder which is the login folder of an FTP server. Once a file has been uploaded, I want windows kernel to interrupt/trigger and start the process. I know I can poll the folder, but I would like...
4
8849
by: Steven De Smet | last post by:
Hello, This is my first post. I searched on the internet for answers but I was unable to solve my problem. So I hope that you guy's can help me with my VB.NET problem I tried to create a windows service that converts MS Word Files into .PDF files and after that we want to zip the .PDF files. Our code: Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set...
0
10505
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
10276
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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,...
1
7580
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
6813
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
5471
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...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
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.