Using shell.application MoveHere doesn't move the file

Discussion in 'Scripting' started by Pat Moline, Aug 12, 2008.

  1. Pat Moline

    Pat Moline Guest

    Our asp page uses the shell.application MoveHere method to move a file from
    one folder on disk drive to another folder on the same disk drive. The disk
    drive is local to the server. The code works fine on two Windows Server 2000
    systems but does not work on a Windows Server 2003 system. Everyone has full
    control of both folders, so it shouldn't be a permissions issue.

    Is there something special that needs to be setup to get this scripting to
    work on a Windows Server 2003 system?

    Thanks in advance.
    Pat Moline
    Pat Moline, Aug 12, 2008
    1. Advertisements

  2. Pat Moline

    J Ford Guest

    Perhaps try and put the script portion is just a VBS file and remove the
    error handling to see what is going on.
    J Ford, Aug 13, 2008
    1. Advertisements

  3. Pat Moline

    Pat Moline Guest

    Thanks for the response. I have already tried that and the VBS script works
    just fine. I have tried it both with my normal login and also the login that
    the website should be using.

    Is there some registry or IIS settings that need to be changed to enable
    this script?

    Pat Moline
    Pat Moline, Aug 13, 2008
  4. Pat Moline

    J Ford Guest

    Perhaps is the security of the share... I know you said 'everyone' had
    permissions, but you might try to implicitly add the IUSR_xxxx account.
    Possible post the script of snippet for better help.
    J Ford, Aug 13, 2008
  5. Pat Moline

    Pat Moline Guest

    Here is the script that is used. It was taken almost directly from a
    Microsoft example.

    function fnMoveHereVB(sFileToMove)
    dim objShell
    dim objFolder
    dim sToFolder
    dim sFromFolder

    sFromFolder = InboundUACTFiles & "\" & sFileToMove
    '"e:\FTPRoot\InboundUACTFiles\" & sFileToMove SR 55918
    sToFolder = UCNStorage '"e:\UCNStorage" SR 55918

    set objShell = CreateObject("Shell.Application")
    set objFolder = objShell.NameSpace(sToFolder)

    if not objFolder is nothing then
    objFolder.MoveHere sFromFolder,1044
    end if

    set objShell = nothing
    set objFolder = nothing
    end function

    Thanks for the help
    Pat Moline, Aug 19, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.