Solved

Accessing remote Shares

Posted on 2002-03-07
12
1,981 Views
Last Modified: 2012-05-04
Hi,

  * I can develop with VB6 (eventually with C#)
  * The servers are NT4 and Win2k
 
  I would like to get files on remote computers, from which I have the IP address and the Computername. The shared could be as well hidden shares (C$. D$ etc) as normal shared (MyShare for example).
  The issue is that I need to "login" to the remote computer, which I could do by creating a mapped drive. I would like to avoid to map a drive for the simple reason that I have to get files from many computers...
  I guess that there is an API to do this, but I failed to locate it, and anyway I will need help to implement it.

CHeers

 
0
Comment
  • 6
  • 5
12 Comments
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6850435
you can use the UNC path for the folder you want. For example

path = "\\servername\sharename$\path\"


0
 
LVL 143

Author Comment

by:Guy Hengel [angelIII / a3]
ID: 6850457
mmcmillen: i know i can use that path, but i have to supply some username/password at some point before that, otherwise i get the "access denied" error when opening this path. Please reread my question...

CHeers
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6850478
And your username/pwd is dfferent on each remote server, or potentially different on each?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 143

Author Comment

by:Guy Hengel [angelIII / a3]
ID: 6850486
it's potentially different on each... in fact it is some local username to that remote servers, eventually some administrator account.
CHeers
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6850506
You don't need to map to the drives but your network administrator needs to give you, or whoever will be running the application permissions to those folders or shares.  One thing we do occasionally is create a dummy user and get permissions for that user to whatever drives we need.  Inside the program you can log in to the servers behind the scenes.
0
 
LVL 143

Author Comment

by:Guy Hengel [angelIII / a3]
ID: 6850519
That implies that on the over 100 servers we need to change some permissions, which is what I wanted to avoid. Also, whenever such a server is reinstalled, this needs to be done again... I would like to "connect" using my code only to that server...

CHeers
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6850632
Then your program will have to connect as the system admin on each server, which i suspect will be different for each server.  I don't think there is anyway around this issue.  
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6850707
Then your program will have to connect as the system admin on each server, which i suspect will be different for each server.  I don't think there is anyway around this issue.  
0
 
LVL 2

Expert Comment

by:mmcmillen
ID: 6850717
If the servers are using NTFS a couple things happen.  Any share set up that is a drive on the server for example \\myserver\c$, is by default set up with admin permissions needed you can not modify this. You can however set up another share, even at the root directory level(not recommended). This new share will have full permissions to anyone accessing it, and wil not require special permissions. If your net admins could set up shares for you to the folders you want you should be ok.
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 100 total points
ID: 6850739
Just a thought,

Can you make your task runs as domain admin user via dcomcnfg
0
 
LVL 143

Author Comment

by:Guy Hengel [angelIII / a3]
ID: 6991257
EDDYKT, that's interesting thought.
Sorry that I'm so late, but email notifications are not really working 100%  :-(
I will check that (first I need to ask if this is allowed...)
CHeers
0
 
LVL 143

Author Comment

by:Guy Hengel [angelIII / a3]
ID: 7080308
Although i made the program running as Service, with startup account as domain admin, your suggestion gave me the good hint.
Sorry that it took so long, but I hoped for other solution.

CHeers
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 - Compare and highlight cell not the same 3 54
RUNRMTCMD from AS/400 12 70
VBA: copy range dynamically based on config sheet v2 3 50
Dinamic report to Crosstab query 9 35
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question