Joey Gfd
Joey Gfd

Reputation: 509

What does this command mean in batch?

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%"

Upvotes: 1

Views: 3017

Answers (6)

Patel TiLAK
Patel TiLAK

Reputation: 74

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.

Upvotes: 3

Jack Murdoch
Jack Murdoch

Reputation: 2894

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/

Upvotes: 0

borrible
borrible

Reputation: 17346

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.

Upvotes: 2

loosecannon
loosecannon

Reputation: 7803

rm is the *NIX version of del

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

Upvotes: 1

agent-j
agent-j

Reputation: 27913

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.

Upvotes: 1

gagabu
gagabu

Reputation: 154

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

Upvotes: 1

Related Questions