5
Performing batch operations
A batch file comprises a set of executable commands. Executing a batch file is the same as executing the
commands one by one. However, execution of a batch file does not guarantee successful execution of
every command in the batch file. If a command has error settings or the conditions for executing the
command are not satisfied, the system skips this command.
You can edit a batch file on your PC, and then upload or download it to the device. If the extension of
the file is not
.bat
, use the
rename
command to change it to
.bat
.
To execute a batch file:
Step Command
1.
Enter system view.
system-view
2.
Execute a batch file.
execute
filename
Setting the file system operation mode
The file systems support the following operation modes:
•
alert
—The system warns you about operations that might cause problems such as file corruption
and data loss. To prevent incorrect operations, use the
alert
mode.
•
quiet
—The system does not prompt for any operation confirmation.
To set the file system operation mode:
Step Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Set the file system operation
mode.
file prompt
{
alert
|
quiet
}
Optional.
The default is
alert
.
File system management examples
# Display the files and the subdirectories in the current directory.
<Sysname> dir
Directory of flash:/
0 -rw- 1344 Jun 12 2013 03:08:40 startup.cfg
1 -rw- 188 Jun 12 2013 03:08:36 system.xml
2 -rw- 10313004 Aug 08 2008 20:00:00 wa4600_fat.bin
15057 KB total (4934 KB free)
# Create new folder
mytest
in the test directory.
<Sysname> cd test
<Sysname> mkdir mytest