Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2008, 04:08 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default Windows service File Search for Mapped Drives

Hi All,

How to search some files which are available in Mapped Drives,through windows service.
eg.My windows service will run on my machine, whatever drives are mapped ,my service will search specific files on that drives,and return path info for that file, to windows service.

Any sample or input??

Thanks,
Vinod

Cheers :)

vinod
__________________
Cheers :)

vinod
 
Old August 3rd, 2008, 08:12 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The problem with windows mapped drives is that (to my knowledge based on experience) they are only visible from the perspective of the user that mapped them. I.e. if you are viewing the drives from a windows server (running under the system account) you won't be able to see the mapped drives. There are supposedly ways to script a drive mapping so it's visible from the system level, but the methods I've tried have not been reliable.

-Peter
compiledthoughts.com
 
Old August 3rd, 2008, 08:59 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think if you configure to run the service under a specific user account, you should see the drive mappings for that account.

Not 100% sure as I never tested this...

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old August 3rd, 2008, 09:16 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I think I've tried this and found it not to be the case.

The drive mappings are restored on user session login. Running a service application under a particular user identity won't provide mappings.

-Peter
compiledthoughts.com
 
Old August 3rd, 2008, 09:48 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think you're right. My bad.... ;)

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Impersonate with windows service for Service A/C vinod_yadav1919 C# 0 October 18th, 2008 02:29 PM
windows service for writting a text file srkarthik_82 General .NET 0 January 4th, 2007 01:31 AM
Accessing Windows service from a windows app sajid08 C# 1 October 6th, 2006 10:25 AM
Opening a file on a non-mapped drive chp Excel VBA 3 February 27th, 2006 05:26 PM
File watcher with Windows service GregF VB.NET 1 February 1st, 2005 09:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.