Solved

Filesearch/filecopy and remote permissions

Posted on 2003-11-07
3
340 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Share codes 68 115
Excel Formula to Pull Data from Text String 7 67
Help in WHSCRIPT 9 41
Excel object stays open 19 65
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now