text stringlengths 0 4.23k |
|---|
Parameters |
Parameter |
Description |
/? |
Displays help at the command prompt. |
Remarks |
The endlocal command has no effect outside a script or batch file. |
There is an implicit endlocal command at the end of a batch file. |
If command extensions are enabled (command extensions are enabled by default), the endlocal command restores the state of command extensions (that is, enabled or disabled) to what it was before the corresponding setlocal command was run. |
Note |
For more information about enabling and disabling command extensions, see the Cmd command. |
Examples |
You can localize environment variables in a batch file. For example, the following program starts the superapp batch program on the network, directs the output to a file, and displays the file in Notepad: |
@echo off |
setlocal |
path=g:\programs\superapp;%path% |
call superapp>c:\superapp.out |
endlocal |
start notepad c:\superapp.out |
erase |
Deletes one or more files. If you use erase to delete a file from your disk, you can't retrieve it. |
Note |
This command is the same as the del command. |
Syntax |
erase [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names> |
del [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names> |
Parameters |
Parameter |
Description |
<names> |
Specifies a list of one or more files or directories. Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted. |
/p |
Prompts for confirmation before deleting the specified file. |
/f |
Forces deletion of read-only files. |
/s |
Deletes specified files from the current directory and all subdirectories. Displays the names of the files as they are being deleted. |
/q |
Specifies quiet mode. You are not prompted for delete confirmation. |
/a[:]<attributes> |
Deletes files based on the following file attributes:r Read-only filesh Hidden filesi Not content indexed filess System filesa Files ready for archivingl Reparse points- Used as a prefix meaning 'not' |
/? |
Displays help at the command prompt. |
<names> |
<attributes> |
Remarks |
If you use the erase /p command, you'll see the following message: |
erase /p |
FileName, Delete (Y/N)? |
FileName, Delete (Y/N)? |
To confirm the deletion, press Y. To cancel the deletion and to display the next file name (if you specified a group of files), press N. To stop the erase command, press CTRL+C. |
If you disable command extension, the /s parameter will display the names of any files that weren't found ,instead of displaying the names of files that are being deleted. |
If you specify specific folders in the <names> parameter, all of the included files will also be deleted. For example, if you want to delete all of the files in the \work folder, type: |
<names> |
erase \work |
You can use wildcards (* and ?) to delete more than one file at a time. However, to avoid deleting files unintentionally, you should use wildcards cautiously. For example, if you type the following command: |
erase *.* |
The erase command displays the following prompt: |
Are you sure (Y/N)? |
Are you sure (Y/N)? |
To delete all of the files in the current directory, press Y and then press ENTER. To cancel the deletion, press N and then press ENTER. |
Note |
Before you use wildcard characters with the erase command, use the same wildcard characters with the dir command to list all the files that will be deleted. |
Examples |
To delete all the files in a folder named Test on drive C, type either of the following: |
erase c:\test |
erase c:\test\*.* |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.