Computing.Net > Forums > Disk Operating System > e100? rcx? w? q?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

e100? rcx? w? q?

Reply to Message Icon

Name: Evan
Date: October 31, 2002 at 19:44:36 Pacific
OS: Sin XP
CPU/Ram: P3 600 / 384 SDRAM
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: November 1, 2002 at 09:54:30 Pacific
Reply:

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 > nul

What does that do? It creates a DEBUG script with the following:

e100'SET %1=' (note the single percent)
rcx
7
w
q

Then, 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 100

rcx
Enter CX register, which controls file size

7
Set file size to 7 bytes

w
Write the file (begginning on ofset 100, by default)

q
Quit

What'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 VARNAME

The 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 VARNAME

Since %temp%.\T1.BAT would contain after line 2:

SET %1=
C:\DIRECTORY

Instead 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

_______________________________________________________


0
Reply to Message Icon

Related Posts

See More


I'd like to install some ... Dos/win98



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: e100? rcx? w? q?

Multiple Errorlevels in IF-command! www.computing.net/answers/dos/multiple-errorlevels-in-ifcommand/10704.html

Batch file - search for file www.computing.net/answers/dos/batch-file-search-for-file/12094.html

append a file www.computing.net/answers/dos/append-a-file/13732.html