Results 1 to 4 of 4

Thread: Need some VB for a move command.

Hybrid View

  1. #1

    Thread Starter
    Lively Member fujiyama17's Avatar
    Join Date
    Aug 2000
    Location
    Columbus, OH
    Posts
    91

    Question

    Like windows, you can move around folders and files by saying "move" and the file will just change directory names instead of a copy, paste, and delete that occurs when you are, say, moving a file to a server. Well, I have different drive names within a server, for example, drive X:/ , Y:/ , and Z:/ all are on the same server volume. I have the task of creating a GUI that moves files around in the server without them coping, pasting and then deleting. I have a DOS program called ncopy that does this, but it's not a GUI. I need help with the programming... is there a way to see the programming language in the DOS of NCopy and make it into a GUI for windows? Help!! Thanks!!

    ~Brian

  2. #2
    Guest
    Code:
    Private Declare Function MoveFile Lib "kernel32" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long
    
    Private Sub Command1_Click()
        MoveFile "c:\file", "c:\newfile"
    End Sub

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    That still won't do it. I think he wants to move files which are physically on the same server, but they have different drive associations. As it can't tell, it copies rather than moves. If you work back from the drive name to find the original device, you can move it under the same subtree. Sorry if this makes no sense .
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Then have a look at the FileSystemObject object. It has methods called MoveFolder, CopyFolder, MoveFile and CopyFile that can act like DOS ncopy or xcopy.

    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width