On 4/25/26 17:51, Java Jive wrote:[]
On 2026-04-26 00:39, T wrote:
On 4/25/26 16:08, Java Jive wrote:
On 2026-04-25 13:08, T wrote:
Assigning variable from call in Batch call drive
me crazy.-a It is STUPID.
And the relevance to your OP and my reply is?
I was following up on the "for" command you mentioned.
And since assigning a returned value to a variable is
bizarre, I included how to do it.
The relevance is that I was building on what you
had added.-a I though you raised a good point.
I copied it down in my keeper and added the following:
rem Switch to a known code page (CHCP command)
CHCP 1252
FOR /F "usebackq tokens=1-4" %%A IN (`CHCP`) DO (
SET _CP=%%D
)
REM Restore original code page
CHCP %_CP%
Note: you really only need tokens=4 since you're only
grabbing the last value
and
Without usebackq (default behavior)
'command' raA runs a command
"file name" raA treated as a file name (only works cleanly without spaces)
With usebackq
`command` raA runs a command
'file name' raA treated as a file name (even with spaces)
"literal string" raA treated as a plain string
THANK YOU!!!
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 00:50:09 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
10 files (20,373K bytes) |
| Messages: | 264,186 |