copying file to sub dir 
Author Message
 copying file to sub dir

hi all

i am trying to write an update to a prog i made a while ago and i have no
trouble copying to the main dir i want but i need to copy to a sub dir and i
can not get it to work.

in the folder with the new files i made the sub dir DLL
is in c:\update\dll

i can copy to c:\dest from c:\update but having trouble copying from
c:\update\dll to c:\dest\dll

Private Sub Command1_Click()
   Dim sSourcePath As String
   Dim sDestination As String
   Dim sFiles As String
   Dim numCopied As Long
   Dim icqdest As String

Command2.Enabled = True

   sSourcePath = "c:\update\"

   progdest = txtdest.Text     'this is where the user types in the location
of the prog

   sDestination = progdest

   sFiles = "*.*"                    'copies all file types

' removes all of the old files

Kill icqdest & "\file1.zzz"

Kill icqdest & "\file2.zzz"

Kill icqdest & "\file3.zzz "

Kill icqdest & "\file4.zzz"

Kill icqdest & "\dll\file5.dll"

'Here is where i have the trouble how do i tell it to copy sub dir's as
well?

numCopied = rgbCopyFiles(sSourcePath, sDestination, sFiles)

   MsgBox numCopied & " files copied to " & sDestination

   MsgBox "Old files have been removed and new files have been copied", 0,
"Notice"

Thanx for any help
steve



Wed, 27 Aug 2003 15:36:26 GMT  
 copying file to sub dir
Some are going to wonder what rgbCopyFiles() is (my initials).

What you need to do is add some debug.print statements to the code to print
out _exactly_ what the sSource, sDestination and sFiles variable holds on
entering the rgbCopyFiles routine. Off-hand, are you sure the variables end
up in the format

  x=c:\update\dll\*.*

and not

  x=c:\update\dll*.*

--

Randy Birch
MVP Visual Basic

Take the vb.net poll at:
http://www.mvps.org/vbnet/
http://www.mvps.org/ccrp/

Please respond only to the newsgroups so all can benefit.


: hi all
:
: i am trying to write an update to a prog i made a while ago and i have no
: trouble copying to the main dir i want but i need to copy to a sub dir and
i
: can not get it to work.
:
: in the folder with the new files i made the sub dir DLL
: is in c:\update\dll
:
: i can copy to c:\dest from c:\update but having trouble copying from
: c:\update\dll to c:\dest\dll
:
:
: Private Sub Command1_Click()
:    Dim sSourcePath As String
:    Dim sDestination As String
:    Dim sFiles As String
:    Dim numCopied As Long
:    Dim icqdest As String
:
:
: Command2.Enabled = True
:
:    sSourcePath = "c:\update\"
:
:    progdest = txtdest.Text     'this is where the user types in the
location
: of the prog
:
:    sDestination = progdest
:
:    sFiles = "*.*"                    'copies all file types
:
: ' removes all of the old files
:
: Kill icqdest & "\file1.zzz"
:
: Kill icqdest & "\file2.zzz"
:
: Kill icqdest & "\file3.zzz "
:
: Kill icqdest & "\file4.zzz"
:
: Kill icqdest & "\dll\file5.dll"
:
: 'Here is where i have the trouble how do i tell it to copy sub dir's as
: well?
:
: numCopied = rgbCopyFiles(sSourcePath, sDestination, sFiles)
:
:    MsgBox numCopied & " files copied to " & sDestination
:
:    MsgBox "Old files have been removed and new files have been copied", 0,
: "Notice"
:
: Thanx for any help
: steve
:
:
:



Wed, 27 Aug 2003 23:43:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. copying file to sub dir

2. copying file to sub dir

3. Detect new/removed files from Dir + sub-dirs ?

4. output filenames and Folders to a text file in a dir and all subs

5. output filenames to a text file in a dir and all subs

6. Copy file to another dir with new name.

7. How to copy dir &files/beginner level

8. Copying files to WinNT dir via logon script?

9. Copy files with sub folder

10. Copy the files and sub folders to another folder

11. Get first sub dir

12. How to check the size of a sub-dir

 

 
Powered by phpBB® Forum Software