<< Click to Display Table of Contents >> Navigation: 3. Script Language > Filesystem-Commands > Filesystem-Commands |
MiniRobotLanguage (MRL)
SHF. Command
SHell File operation
Intention
This command is used to copy, rename, move or delete files or folders.
You can specify wildcards "*" and "?".
The command puts a 0 (Operation failed or was aborted) or a 1 (operation successfull) on the stack to show if the operation was successful or not.
SHF. Supports the use of wildcards (* and ?). Also a progress-dialog can be displayed using the "p"-flag.
The command in its default-settings does not ask for any confirmation and can do serious damages to your files and data. Therefore be careful and use it at your own risk!
On an test-system a file with 11.1 GB was copied in ~169 seconds using SHF. (Shell-File Operations). These times depend on the specific test system.
' Copy file with SHF.
VAR.$$TIM=#dtime#
: $$SRC=F:\O5-26-05.pst
: $$TAR=?desktop\Testfile.pst
SHF.c|pcm|$$SRC|$$TAR
STS.DUMP
MBX.Ready: #dsince#
ENR.
' Copy all content of the
' folder "Test" into the Folder "tar"
'
VAR.§§SRC=?pfad\Test\*
VAR.§§TAR=?pfad\tar\
SHF.c|p|§§SRC|§§TAR
ENR.
This command internally calls the "Windows-Shell" and therefore does currently not support the "NTFSD-Feature".
Syntax
SHF.P1|P2|P3[|P4]
Parameter Explanation
P1 - Operations-Code
c - copy,
m - move,
r - rename or
d - delete
P2 - Flags
p - progress-dialog ( if not set, no progress is displayed. )
c - confirmation. If set you may need to responds to dialog boxes
that is displayed on file-conflicts.
Default is that the conflict is solved with "Yes to All",
that is, everything is forced.
r - rename-on-collision. Gives the file being operated on a new
name (such as "Copy #1 of...")in a move, copy, or rename
operation if a file of the target name already exists.
f - Files-Only. Performs the operation only on files if a
wildcard filename (*.*) is specified.
m - Confirm-MakeDir. If specified, does need the user to confirm
the creation of a new directory if the operation requires
one to be created.
u - Allow-Undo. Preserves undo information, if possible.
By adding the Allow-undo flag you can move a file to the
Recycle Bin instead of deleting it.
P3 - Variable with source-file
P4 - must be there for any operation other then delete.
Example
'*****************************************************
' EXAMPLE 1: SHF.
'*****************************************************
: §§PAT=F:\Testfiles
VAR.§§FIL=§§PAT\Audiograbber.zip
VAR.§§TAR=§§PAT\Target.zip
VAR.§§TAC=§§PAT\recent\Target.zip
VAR.§§TAB=§§PAT\Targez.zip
' Simple copy-Operation
SHF.c||§§FIL|§§TAR
' Rename File Operation
SHF.r||§§TAR|§§TAB
' Move File Operation, where rename doesnt work
SHF.m||§§TAB|§§TAC
PAU.2
' Delete File Operation
SHF.d||§§TAB
END.
Remarks
This command makes permanent changes to the file-system. Use with caution.
Limitations:
-
See also:
• IEF. / NEF. - If - exist - File