By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,664 Members | 1,999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,664 IT Pros & Developers. It's quick & easy.

How to FileCopy to remote machine?

P: n/a
In a multi-user environment, I have a table that stores hyperlinks to
documents that are stored on the machine that hosts the mdb database. The
table entry looks like this:

ProductDescription.htm#file:\\DBHOST\C$\Documents and
Settings\Administrator\My
Documents\Products\Documents\ProductDescription.ht m

Having the hyperlink in this format allows the document to be opened by
anyone on the local area network.

The problem is when a remote user wants to add a document link - I have a
function that will populate the table with the above string, but how do I
copy the document to the DBHOST?

I've tried using FileCopy:

FileCopy C:\DirectoryonRemoteMachine\ProductDescription.htm
\\DBHOST\C$\Documents and Settings\Administrator\My
Documents\Products\Documents\ProductDescription.ht m

But that doesn't work.

Do I need to use the API here?

Private Declare Function CopyFile Lib "kernel32" _
( _
existingfile As String, _
newfile As String, _
failIfExists As Boolean _
)

It's safe to assume that a drive is mapped to the DBHOST - is there a way to
determine the drive letter and construct a target path that way? Other
options?

Thanks in advance.
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As far as I know the target file path has this syntax:

\\server_name\drive:\folder_name\file_name

E.g.:

xcopy c:\myfile.txt \\SharedServer\\D:\SharedDocs\Joes_File.txt

Copies myfile.txt to the server "SharedServer," D: drive, folder
"SharedDocs," into the file Joes_File.txt.

Of course, the machines must be on the same network and the source
machine/user must have permissions to copy files into the target
machine.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQUneI4echKqOuFEgEQIndACg+ellJ2XF9GFzQoTi+rtfX+ 4jg9kAnjQv
ReQxs+CrPRpRkzUAKGMdDG1Q
=pVK6
-----END PGP SIGNATURE-----
deko wrote:
In a multi-user environment, I have a table that stores hyperlinks to
documents that are stored on the machine that hosts the mdb database. The
table entry looks like this:

ProductDescription.htm#file:\\DBHOST\C$\Documents and
Settings\Administrator\My
Documents\Products\Documents\ProductDescription.ht m

Having the hyperlink in this format allows the document to be opened by
anyone on the local area network.

The problem is when a remote user wants to add a document link - I have a
function that will populate the table with the above string, but how do I
copy the document to the DBHOST?

I've tried using FileCopy:

FileCopy C:\DirectoryonRemoteMachine\ProductDescription.htm
\\DBHOST\C$\Documents and Settings\Administrator\My
Documents\Products\Documents\ProductDescription.ht m

But that doesn't work.

Do I need to use the API here?

Private Declare Function CopyFile Lib "kernel32" _
( _
existingfile As String, _
newfile As String, _
failIfExists As Boolean _
)

It's safe to assume that a drive is mapped to the DBHOST - is there a way to
determine the drive letter and construct a target path that way? Other
options?


Nov 13 '05 #2

P: n/a
> xcopy c:\myfile.txt \\SharedServer\\D:\SharedDocs\Joes_File.txt

Hi and thanks for the reply.

Well, I could try xcopy instead of FileCopy - but I still need to discover
the drive letter (used by the client) that maps to the DBHOST machine. I
think I need to walk some registry keys for this... ?

By the way, I'm not sure why I'm using $ in my links (in the table). This
works, but not sure why:

ProductDescription.htm#file:\\DBHOST\C$\Documents and
Settings\Administrator\My
Documents\Products\Documents\ProductDescription.ht m

This link, and the document it points to, is stored on the DBHOST machine
(all documents are stored on the DBHOST machine) - so the drive letter (C$)
is consistent. But the client may have any letter mapped to the DBHOST.
So, if a remote machine attempts to add a document (i.e. link a document to
a customer entry in the database), and the document is located on the remote
machine, the document must first be copied to the DBHOST (as well as adding
the link to the table) - that's why I need the drive letter. I think I read
something about using the registry to determine drive mappings... or, I
could just tell users to use a specific drive letter when mapping to the
database.
Nov 13 '05 #3

P: n/a
"deko" <ww*******************************@nospam.com> wrote in
news:Qf*******************@newssvr27.news.prodigy. com:
In a multi-user environment, I have a table that stores hyperlinks to
documents that are stored on the machine that hosts the mdb database.
The table entry looks like this:

ProductDescription.htm#file:\\DBHOST\C$\Documents and
Settings\Administrator\My
Documents\Products\Documents\ProductDescription.ht m

Having the hyperlink in this format allows the document to be opened
by anyone on the local area network.

The problem is when a remote user wants to add a document link - I
have a function that will populate the table with the above string,
but how do I copy the document to the DBHOST?

I've tried using FileCopy:

FileCopy C:\DirectoryonRemoteMachine\ProductDescription.htm
\\DBHOST\C$\Documents and Settings\Administrator\My
Documents\Products\Documents\ProductDescription.ht m

But that doesn't work.

Do I need to use the API here?

Private Declare Function CopyFile Lib "kernel32" _
( _
existingfile As String, _
newfile As String, _
failIfExists As Boolean _
)

It's safe to assume that a drive is mapped to the DBHOST - is there a
way to determine the drive letter and construct a target path that
way? Other options?

Thanks in advance.


If you're prepared to use Visual Basic Scripting, then this may help.
You'll need a Reference to the Scripting Library.
It's one of these on my Win98 Access97 machine.

C:\WINDOWS\SYSTEM\SCRRUN.DLL
C:\WINDOWS\SYSTEM\MSSCP.DLL
C:\WINDOWS\SYSTEM\WSHOM.OCX

(This may be Overkill, of course)

'Visual Basic Scripting Edition Language Reference
'FileSystemObjectSample Code
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' FileSystemObject Sample Code
' Copyright 1998 Microsoft Corporation. All Rights Reserved.
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Option Explicit

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' Regarding code quality:
' 1) The following code does a lot of string manipulation by
' concatenating short strings together with the "&" operator.
' Since string concatenation is expensive, this is a very
' inefficient way to write code. However, it is a very
' maintainable way to write code, and is used here because this
' program performs extensive disk operations, and because the
' disk is much slower than the memory operations required to
' concatenate the strings. Keep in mind that this is demonstration
' code, not production code.
'
' 2) "Option Explicit" is used, because declared variable access is
' slightly faster than undeclared variable access. It also prevents
' bugs from creeping into your code, such as when you misspell
' DriveTypeCDROM as DriveTypeCDORM.
'
' 3) Error handling is absent from this code, to make the code more
' readable. Although precautions have been taken to ensure that the
' code will not error in common cases, file systems can be
' unpredictable. In production code, use On Error Resume Next and
' the Err object to trap possible errors.
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' Some handy global variables
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
Dim TabStop
Dim NewLine

Const TestDrive = "C"
Const TestFilePath = "C:\Test"

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' Constants returned by Drive.DriveType
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
Const DriveTypeRemovable = 1
Const DriveTypeFixed = 2
Const DriveTypeNetwork = 3
Const DriveTypeCDROM = 4
Const DriveTypeRAMDisk = 5

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' Constants returned by File.Attributes
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
Const FileAttrNormal = 0
Const FileAttrReadOnly = 1
Const FileAttrHidden = 2
Const FileAttrSystem = 4
Const FileAttrVolume = 8
Const FileAttrDirectory = 16
Const FileAttrArchive = 32
Const FileAttrAlias = 64
Const FileAttrCompressed = 128

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' Constants for opening files
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
Const OpenFileForReading = 1
Const OpenFileForWriting = 2
Const OpenFileForAppending = 8

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' ShowDriveType
' Purpose:
' Generates a string describing the drive type of a given Drive object.
' Demonstrates the following
' - Drive.DriveType
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
Function ShowDriveType(Drive)

Dim s

Select Case Drive.DriveType
Case DriveTypeRemovable
s = "Removable"
Case DriveTypeFixed
s = "Fixed"
Case DriveTypeNetwork
s = "Network"
Case DriveTypeCDROM
s = "CD-ROM"
Case DriveTypeRAMDisk
s = "RAM Disk"
Case Else
s = "Unknown"
End Select

ShowDriveType = s

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' ShowFileAttr
' Purpose:
' Generates a string describing the attributes of a file or folder.
' Demonstrates the following
' - File.Attributes
' - Folder.Attributes
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Function ShowFileAttr(File) ' File can be a file or folder

Dim s
Dim Attr

Attr = File.Attributes

If Attr = 0 Then
ShowFileAttr = "Normal"
Exit Function
End If

If Attr And FileAttrDirectory Then s = s & "Directory "
If Attr And FileAttrReadOnly Then s = s & "Read-Only "
If Attr And FileAttrHidden Then s = s & "Hidden "
If Attr And FileAttrSystem Then s = s & "System "
If Attr And FileAttrVolume Then s = s & "Volume "
If Attr And FileAttrArchive Then s = s & "Archive "
If Attr And FileAttrAlias Then s = s & "Alias "
If Attr And FileAttrCompressed Then s = s & "Compressed "

ShowFileAttr = s

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' GenerateDriveInformation
' Purpose:
' Generates a string describing the current state of the
' available drives.
' Demonstrates the following
' - FileSystemObject.Drives
' - Iterating the Drives collection
' - Drives.Count
' - Drive.AvailableSpace
' - Drive.DriveLetter
' - Drive.DriveType
' - Drive.FileSystem
' - Drive.FreeSpace
' - Drive.IsReady
' - Drive.Path
' - Drive.SerialNumber
' - Drive.ShareName
' - Drive.TotalSize
' - Drive.VolumeName
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Function GenerateDriveInformation(fso)

Dim Drives
Dim Drive
Dim s

Set Drives = fso.Drives
s = "Number of drives:" & TabStop & Drives.Count & NewLine & NewLine

' Construct 1st line of report.
s = s & String(2, TabStop) & "Drive"
s = s & String(3, TabStop) & "File"
s = s & TabStop & "Total"
s = s & TabStop & "Free"
s = s & TabStop & "Available"
s = s & TabStop & "Serial" & NewLine

' Construct 2nd line of report.
s = s & "Letter"
s = s & TabStop & "Path"
s = s & TabStop & "Type"
s = s & TabStop & "Ready?"
s = s & TabStop & "Name"
s = s & TabStop & "System"
s = s & TabStop & "Space"
s = s & TabStop & "Space"
s = s & TabStop & "Space"
s = s & TabStop & "Number" & NewLine

' Separator line.
s = s & String(105, "-") & NewLine

For Each Drive In Drives
s = s & Drive.DriveLetter
s = s & TabStop & Drive.path
s = s & TabStop & ShowDriveType(Drive)
s = s & TabStop & Drive.IsReady

If Drive.IsReady Then
If DriveTypeNetwork = Drive.DriveType Then
s = s & TabStop & Drive.ShareName
Else
s = s & TabStop & Drive.VolumeName
End If
s = s & TabStop & Drive.FileSystem
s = s & TabStop & Drive.TotalSize
s = s & TabStop & Drive.FreeSpace
s = s & TabStop & Drive.AvailableSpace
s = s & TabStop & Hex(Drive.SerialNumber)
End If

s = s & NewLine

Next

GenerateDriveInformation = s

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' GenerateFileInformation
' Purpose:
' Generates a string describing the current state of a file.
' Demonstrates the following
' - File.Path
' - File.Name
' - File.Type
' - File.DateCreated
' - File.DateLastAccessed
' - File.DateLastModified
' - File.Size
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Function GenerateFileInformation(File)

Dim s

s = NewLine & "Path:" & TabStop & File.path
s = s & NewLine & "Name:" & TabStop & File.Name
s = s & NewLine & "Type:" & TabStop & File.Type
s = s & NewLine & "Attribs:" & TabStop & ShowFileAttr(File)
s = s & NewLine & "Created:" & TabStop & File.DateCreated
s = s & NewLine & "Accessed:" & TabStop & File.DateLastAccessed
s = s & NewLine & "Modified:" & TabStop & File.DateLastModified
s = s & NewLine & "Size" & TabStop & File.Size & NewLine

GenerateFileInformation = s

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' GenerateFolderInformation
' Purpose:
' Generates a string describing the current state of a folder.
' Demonstrates the following
' - Folder.Path
' - Folder.Name
' - Folder.DateCreated
' - Folder.DateLastAccessed
' - Folder.DateLastModified
' - Folder.Size
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Function GenerateFolderInformation(Folder)

Dim s

s = "Path:" & TabStop & Folder.path
s = s & NewLine & "Name:" & TabStop & Folder.Name
s = s & NewLine & "Attribs:" & TabStop & ShowFileAttr(Folder)
s = s & NewLine & "Created:" & TabStop & Folder.DateCreated
s = s & NewLine & "Accessed:" & TabStop & Folder.DateLastAccessed
s = s & NewLine & "Modified:" & TabStop & Folder.DateLastModified
s = s & NewLine & "Size:" & TabStop & Folder.Size & NewLine

GenerateFolderInformation = s

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' GenerateAllFolderInformation
' Purpose:
' Generates a string describing the current state of a
' folder and all files and subfolders.
' Demonstrates the following
' - Folder.Path
' - Folder.SubFolders
' - Folders.Count
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Function GenerateAllFolderInformation(Folder)

Dim s
Dim SubFolders
Dim SubFolder
Dim Files
Dim File

s = "Folder:" & TabStop & Folder.path & NewLine & NewLine
Set Files = Folder.Files

If 1 = Files.Count Then
s = s & "There is 1 file" & NewLine
Else
s = s & "There are " & Files.Count & " files" & NewLine
End If

If Files.Count <> 0 Then
For Each File In Files
s = s & GenerateFileInformation(File)
Next
End If

Set SubFolders = Folder.SubFolders

If 1 = SubFolders.Count Then
s = s & NewLine & "There is 1 sub folder" & NewLine & NewLine
Else
s = s & NewLine & "There are " & SubFolders.Count & " sub folders" _
& NewLine & NewLine
End If

If SubFolders.Count <> 0 Then
For Each SubFolder In SubFolders
s = s & GenerateFolderInformation(SubFolder)
Next
s = s & NewLine
For Each SubFolder In SubFolders
s = s & GenerateAllFolderInformation(SubFolder)
Next
End If

GenerateAllFolderInformation = s

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' GenerateTestInformation
' Purpose:
' Generates a string describing the current state of the C:\Test
' folder and all files and subfolders.
' Demonstrates the following
' - FileSystemObject.DriveExists
' - FileSystemObject.FolderExists
' - FileSystemObject.GetFolder
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Function GenerateTestInformation(fso)

Dim TestFolder
Dim s

If Not fso.DriveExists(TestDrive) Then Exit Function
If Not fso.FolderExists(TestFilePath) Then Exit Function

Set TestFolder = fso.GetFolder(TestFilePath)

GenerateTestInformation = GenerateAllFolderInformation(TestFolder)

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' DeleteTestDirectory
' Purpose:
' Cleans up the test directory.
' Demonstrates the following
' - FileSystemObject.GetFolder
' - FileSystemObject.DeleteFile
' - FileSystemObject.DeleteFolder
' - Folder.Delete
' - File.Delete
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Sub DeleteTestDirectory(fso)

Dim TestFolder
Dim SubFolder
Dim File

' Two ways to delete a file:

fso.DeleteFile (TestFilePath & "\Beatles\OctopusGarden.txt")

Set File = fso.GetFile(TestFilePath & "\Beatles\BathroomWindow.txt")
File.Delete

' Two ways to delete a folder:
fso.DeleteFolder (TestFilePath & "\Beatles")
fso.DeleteFile (TestFilePath & "\ReadMe.txt")
Set TestFolder = fso.GetFolder(TestFilePath)
TestFolder.Delete

End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' CreateLyrics
' Purpose:
' Builds a couple of text files in a folder.
' Demonstrates the following
' - FileSystemObject.CreateTextFile
' - TextStream.WriteLine
' - TextStream.Write
' - TextStream.WriteBlankLines
' - TextStream.Close
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Sub CreateLyrics(Folder)

Dim TextStream

Set TextStream = Folder.CreateTextFile("OctopusGarden.txt")

' Note that this does not add a line feed to the file.
TextStream.Write ("Octopus' Garden ")
TextStream.WriteLine ("(by Ringo Starr)")
TextStream.WriteBlankLines (1)
TextStream.WriteLine ("I'd like to be under the sea in an octopus'
garden in the shade,")
TextStream.WriteLine ("He'd let us in, knows where we've been -- in his
octopus' garden in the shade.")
TextStream.WriteBlankLines (2)

TextStream.Close

Set TextStream = Folder.CreateTextFile("BathroomWindow.txt")
TextStream.WriteLine ("She Came In Through The Bathroom Window (by
Lennon/McCartney)")
TextStream.WriteLine ("")
TextStream.WriteLine ("She came in through the bathroom window protected
by a silver spoon")
TextStream.WriteLine ("But now she sucks her thumb and wanders by the
banks of her own lagoon")
TextStream.WriteBlankLines (2)
TextStream.Close

End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' GetLyrics
' Purpose:
' Displays the contents of the lyrics files.
' Demonstrates the following
' - FileSystemObject.OpenTextFile
' - FileSystemObject.GetFile
' - TextStream.ReadAll
' - TextStream.Close
' - File.OpenAsTextStream
' - TextStream.AtEndOfStream
' - TextStream.ReadLine
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Function GetLyrics(fso)

Dim TextStream
Dim s
Dim File

' There are several ways to open a text file, and several
' ways to read the data out of a file. Here's two ways
' to do each:

Set TextStream = fso.OpenTextFile(TestFilePath &
"\Beatles\OctopusGarden.txt", OpenFileForReading)

s = TextStream.readAll & NewLine & NewLine
TextStream.Close

Set File = fso.GetFile(TestFilePath & "\Beatles\BathroomWindow.txt")
Set TextStream = File.OpenAsTextStream(OpenFileForReading)
Do While Not TextStream.AtEndOfStream
s = s & TextStream.ReadLine & NewLine
Loop
TextStream.Close

GetLyrics = s

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' BuildTestDirectory
' Purpose:
' Builds a directory hierarchy to demonstrate the FileSystemObject.
' We'll build a hierarchy in this order:
' C:\Test
' C:\Test\ReadMe.txt
' C:\Test\Beatles
' C:\Test\Beatles\OctopusGarden.txt
' C:\Test\Beatles\BathroomWindow.txt
' Demonstrates the following
' - FileSystemObject.DriveExists
' - FileSystemObject.FolderExists
' - FileSystemObject.CreateFolder
' - FileSystemObject.CreateTextFile
' - Folders.Add
' - Folder.CreateTextFile
' - TextStream.WriteLine
' - TextStream.Close
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Function BuildTestDirectory(fso)

Dim TestFolder
Dim SubFolders
Dim SubFolder
Dim TextStream

' Bail out if (a) the drive does not exist, or if (b) the directory is
being built
' already exists.

If Not fso.DriveExists(TestDrive) Then
BuildTestDirectory = False
Exit Function
End If

If fso.FolderExists(TestFilePath) Then
BuildTestDirectory = False
Exit Function
End If

Set TestFolder = fso.CreateFolder(TestFilePath)

Set TextStream = fso.CreateTextFile(TestFilePath & "\ReadMe.txt")
TextStream.WriteLine ("My song lyrics collection")
TextStream.Close

Set SubFolders = TestFolder.SubFolders
Set SubFolder = SubFolders.Add("Beatles")
CreateLyrics SubFolder
BuildTestDirectory = True

End Function

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''
' The main routine
' First, it creates a test directory, along with some subfolders
' and files. Then, it dumps some information about the available
' disk drives and about the test directory, and then cleans
' everything up again.
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''

Sub Main()

Dim fso

' Set up global data.
TabStop = Chr(9)
NewLine = Chr(10)

Set fso = CreateObject("Scripting.FileSystemObject")

If Not BuildTestDirectory(fso) Then
MsgBox "Test directory already exists or cannot be created. Cannot
continue."
Exit Sub
End If

MsgBox GenerateDriveInformation(fso) & NewLine & NewLine
MsgBox GenerateTestInformation(fso) & NewLine & NewLine
MsgBox GetLyrics(fso) & NewLine & NewLine
DeleteTestDirectory fso

End Sub

<www.clearpointsystems.com
Nov 13 '05 #4

P: n/a
> If you're prepared to use Visual Basic Scripting, then this may help.
You'll need a Reference to the Scripting Library.
It's one of these on my Win98 Access97 machine.

C:\WINDOWS\SYSTEM\SCRRUN.DLL
C:\WINDOWS\SYSTEM\MSSCP.DLL
C:\WINDOWS\SYSTEM\WSHOM.OCX

(This may be Overkill, of course)


Looks interesting. I'll play around with it - but yeah, it is a bit much.
I'm thinking I could popup a form - if the first attempt to copy fails -
asking the user which drive is mapped to the DBHOST - and then use that
input to rewrite the copy string and try again.
Nov 13 '05 #5

P: n/a
"deko" <ww*******************************@nospam.com> wrote in
news:3f*******************@newssvr27.news.prodigy. com:

(This may be Overkill, of course)


Looks interesting. I'll play around with it - but yeah, it is a bit
much. I'm thinking I could popup a form - if the first attempt to copy
fails - asking the user which drive is mapped to the DBHOST - and then
use that input to rewrite the copy string and try again.


A much better idea. As you said, interesting, but Scripting Host on a
Business machine has always seemed a little too hacker-prone.

Sorry I had to send code instead of the link. I Googled " FileSystemObject
Sample Code" and tried the Microsoft link but it had died.

In fact, if you _do_ decide to take that approach, You'd be better off
looking for a more specific example.

Cheers,
Alan Carpenter
Nov 13 '05 #6

P: n/a
"deko" <ww*******************************@nospam.com> wrote in message news:<3f*******************@newssvr27.news.prodigy .com>...
If you're prepared to use Visual Basic Scripting, then this may help.
You'll need a Reference to the Scripting Library.
It's one of these on my Win98 Access97 machine.

C:\WINDOWS\SYSTEM\SCRRUN.DLL
C:\WINDOWS\SYSTEM\MSSCP.DLL
C:\WINDOWS\SYSTEM\WSHOM.OCX

(This may be Overkill, of course)


Looks interesting. I'll play around with it - but yeah, it is a bit much.
I'm thinking I could popup a form - if the first attempt to copy fails -
asking the user which drive is mapped to the DBHOST - and then use that
input to rewrite the copy string and try again.


Expecting an intelligent user? haven't we been here before? I'd just
use the UNC, which CAN'T be messed up... (well, not too easily!)
Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.