What does this command mean in batch?

2019-08-12 15:56发布

I'm looking at a batch file and I see the line below. I know what %LOG% is, but I do not know what the "rm" command is doing. Can anyone tell me?

rm "%LOG%"

6条回答
【Aperson】
2楼-- · 2019-08-12 16:43

%LOG% - variable that contain path to log file and that command remove it.

查看更多
我命由我不由天
3楼-- · 2019-08-12 16:45

rm is not a standard ms-dos command. If you type it on the command line, what comes up?

perhaps it is short for rmdir (a synonym of rd) which removes the specified directory.

查看更多
Rolldiameter
4楼-- · 2019-08-12 16:47

The rm is a command that's being run, rather than anything special for the batch file. Does the system which ran this batch file include the cygwin package? That provides Windows / DOS versions of various standard unix utilities, including rm - which is the remove command - similar to del on such boxes.

查看更多
Deceive 欺骗
5楼-- · 2019-08-12 16:53

rm is a commandlet in Windows Powershell.

NAME: Remove-Item

SYNOPSIS: Deletes the specified items.

DESCRIPTION: The Remove-Item cmdlet deletes one or more items. Because it is supported by many providers, it can delete many different types of items, including files, directories, registry keys, variables, aliases, and functions.

%LOG% is a variable defined in that batch file using set LOG="Something" (NOTE: It is not a global Variable or alias) So what it will do is delete the item pointed by variable LOG.

查看更多
放我归山
6楼-- · 2019-08-12 16:55

Even if this is not Unix, rm is going to be a command to delete a file. For example, see http://www.mkssoftware.com/docs/man1/rm.1.asp or http://www.cygwin.com/

查看更多
7楼-- · 2019-08-12 16:59

rm is the *NIX version of del

so its deleting %LOG%, unless it fails b/s its not a command on Windows. ( PowwerShell maybe)

查看更多
登录 后发表回答