How do I loop through ASCII values (here, alphabets) and work on them?
I want to echo A to Z without having to type every character manually like
for %%J in (
The simplest solution is to include this PowerShell one-liner in your bat script:
powershell "[char[]](65..90)"
It's not necessarily the fastest, though.
Here's a VBScript solution similar to Hackoo's, but in a hybrid format not relying on writing an external .vbs file. Save it with a .bat extension. The cscript line is what triggers execution of the VBScript hybrid code.
Or if you're more comfortable with JavaScript syntax, here's a Batch + JScript hybrid.
@if (@CodeSection == @Batch) @then
@echo off & setlocal
cscript /nologo /e:JScript "%~f0"
goto :EOF
@end // end Batch / begin JScript
for (var i=65; i<=90; i++) WSH.Echo(String.fromCharCode(i));