Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following batch script:

set logFile=%1_%time:~0,2%_%time:~3,2%.log

set logFile=%logFile: =%

Does anyone know what the second line is all about?

share|improve this question
up vote 5 down vote accepted

It says replace all spaces with nothing. If logfile was "This Is a Test" then after the second line, it would be "ThisIsaTest" (spaces equal nothing)

share|improve this answer

MultiverseIT described what's going on. For more detail on environment variable substitution, look at the help for the SET command

Set /?

on the command line

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.