Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I keep seeing e100'SET blah blah and FOR %x IN (rcx w q). What is all this? Is it hex, but what does it all mean? It seems that e100 is some kind of start of file. Me == Uber confused.

Well, I post those strings often on this forum, on batch-related subjects. Here's an example:
echo e100'SET %%1='> %temp%.\T1.BAT
for %%? in (rcx 7 w q) do echo %%?>> %temp%.\T1.BAT
type %temp%.\T1.BAT |DEBUG %temp%.\T1.BAT > nulWhat does that do? It creates a DEBUG script with the following:
e100'SET %1=' (note the single percent)
rcx
7
w
qThen, use the script with DEBUG on the same temporary file containing the script (I could affect another file, but I rather use only one).
But what does the script do? I'll give a *quick* explanation:
e100'SET %1='
Write the string "SET %1=" (no quotes) to offset 100rcx
Enter CX register, which controls file size7
Set file size to 7 bytesw
Write the file (begginning on ofset 100, by default)q
QuitWhat's the result? The result is a file which contains:
SET %1=
And nothing more. If I had done a "echo SET %%1=>> %temp%.\T1.BAT", the file would be:
SET %1=..
Those two dots are representing the CR/LF characters, which mark a line break on DOS. So, if I append any string to the file created with the DEBUG script, the data will be located right after the equals sign. This way, I can send it to a variable.
echo e100'SET %%1='> %temp%.\T1.BAT
for %%? in (rcx 7 w q) do echo %%?>> %temp%.\T1.BAT
type %temp%.\T1.BAT |DEBUG %temp%.\T1.BAT > nul
CD >> %temp%.\T1.BAT
call %temp%.\T1.BAT VARNAMEThe output of the CD command is saved on the VARNAME variable. Now, this wouldn't do it:
echo SET %%1=> %temp%.\T1.BAT
CD >> %temp%.\T1.BAT
call %temp%.\T1.BAT VARNAMESince %temp%.\T1.BAT would contain after line 2:
SET %1=
C:\DIRECTORYInstead of
SET %1=C:\DIRECTORY
This last one is achieved with all that e100/rcx/w/q thing. Nevertheless, all that is unecessary on NT systems, since you can use FOR /F:
for /F %%I in ('CD') do set VARNAME=%%I
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br_______________________________________________________

![]() |
I'd like to install some ...
|
Dos/win98
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |