'To - From, From - To Flags
'File Op Flags
CONST FOF_MULTIDESTFILES
= &H1 CONST FOF_CONFIRMMOUSE
= &H2 CONST FOF_RENAMEONCOLLISION
= &H8 CONST FOF_NOCONFIRMATION
= &H10 CONST FOF_WANTMAPPINGHANDLE
= &H20 CONST FOF_ALLOWUNDO
= &H40 CONST FOF_FILESONLY
= &H80 CONST FOF_SIMPLEPROGRESS
= &H100 CONST FOF_NOCONFIRMMKDIR
= &H200 CONST FOF_NOERRORUI
= &H400 CONST FOF_NOCOPYSECURITYATTRIBS
= &H800 CONST FOF_NORECURSION
= &H1000 CONST FOF_NO_CONNECTED_ELEMENTS
= &H2000 CONST FOF_WANTNUKEWARNING
= &H4000 CONST FOF_NORECURSEREPARSE
= &H8000 CONST FOF_NO_UI
= FOF_SILENT
'Return Values
CONST DE_MANYSRC1DEST
= &H72 CONST DE_OPCANCELLED
= &H75 CONST DE_DESTSUBTREE
= &H76 CONST DE_ACCESSDENIEDSRC
= &H78 CONST DE_PATHTOODEEP
= &H79 CONST DE_INVALIDFILES
= &H7C CONST DE_DESTSAMETREE
= &H7D CONST DE_FLDDESTISFILE
= &H7E CONST DE_FILEDESTISFLD
= &H80 CONST DE_FILENAMETOOLONG
= &H81 CONST DE_DEST_IS_CDROM
= &H82 CONST DE_DEST_IS_DVD
= &H83 CONST DE_DEST_IS_CDRECORD
= &H84 CONST DE_FILE_TOO_LARGE
= &H85 CONST DE_SRC_IS_CDROM
= &H86 CONST DE_SRC_IS_DVD
= &H87 CONST DE_SRC_IS_CDRECORD
= &H88 CONST DE_ERROR_MAX
= &HB7 CONST ERRORONDEST
= &H10000 CONST DE_ROOTDIR_ERRORONDEST
= &H10074
FUNCTION FileOperation%
ALIAS SHFileOperationA
(lpFileOp
AS SHFILEOPSTRUCTA
)
'Test code
'IF _FILEEXISTS(_DIR$("desktop") + "this is a test.txt") = 0 THEN
' OPEN _DIR$("desktop") + "this is a test.txt" FOR OUTPUT AS #1
' CLOSE #1
'END IF
'PRINT Copy(_DIR$("desktop") + "this is a test.txt", _DIR$("desktop") + "this is a test as well.txt")
'_DELAY 2
'PRINT Rename(_DIR$("desktop") + "this is a test as well.txt", _DIR$("desktop") + "this is a test also.txt")
'_DELAY 2
'PRINT Recycle(_DIR$("desktop") + "this is a test also.txt")
'_DELAY 2
'PRINT GetRecycleInfo
'_DELAY 2
'PRINT EmptyBin
'SLEEP
'DIM cart(5) AS STRING
'cart(1) = _DIR$("desktop") + "QB64 x64\GetComputerName.bas"
'cart(2) = _DIR$("desktop") + "QB64 x64\timediff.bas"
'cart(3) = _DIR$("desktop") + "QB64 x64\qrtag api.bas"
'cart(4) = _DIR$("desktop") + "QB64 x64\Genderize API.bas"
'cart(5) = _DIR$("desktop") + "QB64 x64\rewind.png.MEM"
'DIM dest AS STRING
'dest = _DIR$("desktop")
'a = RunTransaction(cart(), dest, 2)
'bplus backup test code
SHELL _HIDE "PowerShell Get-ChildItem '" + _STARTDIR$ + "' -exclude *.exe | where {! $_.PSIsContainer} | foreach {$_.Name} | Out-File dirslist.txt -Encoding ASCII" 'Replace _STARTDIR$ with whatever directory contains the files ' used -exclude *.exe since you said you didn't want EXEs to be copied
x = x + 1
dest
= _DIR$("desktop") + "Test Folder"a = RunTransaction(filelist(), dest, 2)
DIM RecycleInfo
AS SHQUERYRBINFO
RecycleInfo.cbsize
= LEN(RecycleInfo
) a~& = QueryRecycleBin(path, RecycleInfo)
GetRecycleInfo
= _TRIM$(STR$(RecycleInfo.i64Size
)) + " bytes, " + _TRIM$(STR$(RecycleInfo.i64NumItems
)) + " items"
DIM lpFileOp
AS SHFILEOPSTRUCTA
file = file + doublenull
lpFileOp.wfunc = FO_DELETE
lpFileOp.fFlags = FOF_ALLOWUNDO + FOF_WANTNUKEWARNING
Recycle = FileOperation(lpFileOp)
DIM lpFileOp
AS SHFILEOPSTRUCTA
file = file + doublenull
dest = dest + doublenull
lpFileOp.wfunc = FO_COPY
lpFileOp.fFlags = FOF_ALLOWUNDO
Copy = FileOperation(lpFileOp)
DIM lpFileOp
AS SHFILEOPSTRUCTA
file = file + doublenull
dest = dest + doublenull
lpFileOp.wfunc = FO_MOVE
lpFileOp.fFlags = FOF_ALLOWUNDO
Move = FileOperation(lpFileOp)
DIM lpFileOp
AS SHFILEOPSTRUCTA
file = file + doublenull
newname = newname + doublenull
lpFileOp.wfunc = FO_RENAME
lpFileOp.fFlags = FOF_ALLOWUNDO
Rename = FileOperation(lpFileOp)
drive = ""
EmptyBin
= EmptyRecycleBin
(0, _OFFSET(drive
), 0)
dest = dest + "\"
a = Recycle(filecart(x))
PRINT "Recycling item "; x;
" of ";
UBOUND(filecart
);
" ("; filecart
(x
);
")" a = Copy(filecart(x), dest + StripDirectory(filecart(x)))
PRINT "Copying item "; x;
" of ";
UBOUND(filecart
);
" ("; filecart
(x
);
")" a = Move(filecart(x), dest + StripDirectory(filecart(x)))
PRINT "Moving item "; x;
" of ";
UBOUND(filecart
);
" ("; filecart
(x
);
")"
StripDirectory$ = OFile$