Skip to content

Document batch variable usage with colon values#1

Draft
Codex wants to merge 3 commits into
mainfrom
codex/add-colon-to-variable
Draft

Document batch variable usage with colon values#1
Codex wants to merge 3 commits into
mainfrom
codex/add-colon-to-variable

Conversation

@Codex
Copy link
Copy Markdown

@Codex Codex AI commented Mar 24, 2026

Batch users asked how to store values containing : (e.g., “sai às 15:30”) without breaking scripts.

  • Guidance: Added README section showing safe set usage with quotes to keep colons and avoid unintended spaces.
  • Examples: Included snippet capturing the current time with colon, echoing messages, escaping leading colons, and stripping colons when needed.
@echo off
setlocal
set "mensagem=Saí às 15:30"
set "horario=%time:~0,5%"
echo %mensagem%
echo Horário atual: %horario%
endlocal
Original prompt

sobre o batch script teria como colocar : em uma variável?

ex: sai às 15:30

@Codex Codex AI changed the title [WIP] Add support for colon in batch script variable Document batch variable usage with colon values Mar 24, 2026
@Codex Codex AI requested a review from DanRayy March 24, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants