< Home

execute

Function

The execute command executes the specified batch file.

Format

execute filename

Parameters

Parameter Description Value
filename Specifies the name of the batch file, suffixed with ".bat".
file-name supports file name association. The disk and directory where the file resides can be automatically associated.
  • Full help: All the disks of the device can be associated and displayed.
  • Partial help: The related disk, directory, and file can be associated and displayed after you enter a specified character string.
The value is a string of 5 to 160 characters.

Views

System view

Default Level

3: Management level

Usage Guidelines

Before running the execute command, ensure that the batch file to be processed is in the current directory; otherwise, the system cannot find the batch file.

The commands in the batch file are executed one by one. The batch file must not contain invisible characters. If any such characters are discovered, the execute command exists from the current process and no rollback is executed.

The execute command does not ensure all the commands in the batch file can be executed. It cannot do a hot backup for itself. No restriction on the format and content is made to the batch file.

The procedure of the execution of the batch file is an automatic procedure, equaling to the implementation of every command manually.

In case of interactive commands, batch file execution waits the device to interact with users before continuing.

When processing files in batches, add the echo off field in the first line to mask command line prompts. After the echo off field is added, the command line prompts and command lines are not displayed when command lines are processed in batches. Comply with the following rules:

  • The echo off field can be added only to the first line of the files to be processed in batches.
  • The echo off field is case-insensitive.
  • The line where the echo off field resides cannot contain any special characters, spaces excluded.

In the batch file, you can enter wait(time) between commands to set a command execution delay. The value of time ranges from 1 to 1800, in seconds. For example, wait(10) indicates that the next command is executed 10 seconds later. The value of wait(time) is case-insensitive. In the line where wait(time) resides, spaces cannot be placed before or after wait(time), or before or after time. Other characters are also not allowed.

Example

# Execute the batch file test.bat in the directory hda1:/.

<sysname> system-view
[sysname] execute test.bat
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >