meoit

Why my app has crashed when DirMove a large folder

3 posts in this topic

#1 ·  Posted (edited)

Hi all.

I have a problem when I using DirMove a large folder, my app has crashed. It's show message box ".....has stopped working. A problem caused the program to stop working correctly..." and a button "Close program".

Code: DirMove(@TempDir & '\xxxFolder', 'H:\', 1)

with:

+ H: is a USB Flash

+ The xxxFolder is a folder larger than 1GB.

Someone help me this problem.

Thanks for all.

Edited by meoit

Share this post


Link to post
Share on other sites



#2 ·  Posted

mmm.. try this..

1. check file permission

2. try to use #RequireAdmin

3. and..... my suspect is that.... usually this folder have trouble because other programs like antivirus etc... stay connect and the the files results open, try to copy it in your desktop and than try to use dirmove from this position.

Share this post


Link to post
Share on other sites

#3 ·  Posted

Couple of days ago I had to copy several hundred GB to a new Server and used the following, without a problem.

_FileCopy($sSource, $sTarget, 784)

;===============================================================================
;
; Function Name:    _FileCopy()
; Description:      Copies Files and/or Folders with optional animated Windows dialog box
; Parameter(s):     $pFrom - Source files/folders to copy from
;                           $pTo - Destination folder to copy to
;                           $fFlags - [optional] Defines the flag for CopyHere action
;
; Option Flags:        $FOF_DEFAULT = 0          Default. No options specified.
;                       $FOF_SILENT = 4              Do not display a progress dialog box.
;                       $FOF_RENAMEONCOLLISION = 8 Rename the target file if a file exists at the target location with the same name.
;                       $FOF_NOCONFIRMATION = 16    Click "Yes to All" in any dialog box displayed.
;                       $FOF_ALLOWUNDO = 64          Preserve undo information, if possible.
;                       $FOF_FILESONLY = 128          Perform the operation only if a wildcard file name (*.*) is specified.
;                       $FOF_SIMPLEPROGRESS = 256   Display a progress dialog box but do not show the file names.
;                       $FOF_NOCONFIRMMKDIR = 512   Do not confirm the creation of a new directory if the operation requires one to be created.
;                       $FOF_NOERRORUI = 1024          Do not display a user interface if an error occurs.
;                       $FOF_NORECURSION = 4096     Disable recursion.
;                       $FOF_SELECTFILES = 9182 Do not copy connected files as a group. Only copy the specified files.
;
; Requirement(s):   None.
; Return Value(s):  No return values per MSDN article.
; Author(s):        Jos, commented & modified by ssubirias3 to create $pTo if not present
; Note(s):          Must declare $fFlag variables or use their numeric equivalents without declaration. Use BitOR() to combine
;                       Flags. See http://support.microsoft.com/kb/151799 &
;                       http://msdn2.microsoft.com/en-us/library/ms723207.aspx for more details
;
;===============================================================================
Func _FileCopy($pFrom, $pTo, $fFlags = 0)
    If Not FileExists($pTo) Then DirCreate($pTo)
    $winShell = ObjCreate("shell.application")
    $winShell.namespace($pTo).CopyHere($pFrom, $fFlags)  ;; or BitOR(16,512)) without declaration
EndFunc

 

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now