Solved

Filesearch/filecopy and remote permissions

Posted on 2003-11-07
3
343 Views
Last Modified: 2010-05-01
I am trying to first get a file directory and then to copy files from a computer on the network.  To make a long story short, I am having problems doing this due to issues with permissions and security on the remote computer.  Is there a way to get file directories and copy files from a remote computer but specifying access using a particular username and password other than that in use on the local computer?  I know this can be and is done when opening remote ODBC data sources.  Can it be done for simple file access?
0
Comment
Question by:beachbt
3 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 250 total points
ID: 9703076
you can map the network share (make sure you reference windows script host object under project/references):

Dim wNet as new WshNetwork
wNet.MapNetworkDrive "Z:", "\\SERVER\SHARE", , <user name>, <password>
set wNet = nothing

now you can do whatever you want w/ Z:

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9703997
Check if that letter is not already used first.
0
 

Author Comment

by:beachbt
ID: 9704086
I'm going to accept Bobbit31's comment as the solution, though I had to do it a slightly different way.  On our systems, the drive mappings are fairly densely populated already, and in a not always predictable fashion.  So selecting a drive to map would be tricky.  But a variation on this, a Shell("NET USE \\server\share /user:<username> <pwd>") allows pretty much the same thing as mapping, but doesn't require an actual drive letter assignment.  Bobbit31 got me looking in this direction, so I'll award him the solution
0

Featured Post

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.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

825 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