[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: U2 Query: file locations
- Subject: Re: U2 Query: file locations
- From: "Robert Holmgren" holmgren@xxxxxxxx
- Date: Mon, 28 Nov 2005 00:55:56 -0500
** Reply to message from "Patricia M. Godfrey" on Sun, 27
Nov 2005 11:16:13 -0500
> Anyone know anything about Python? A whole setup of it got dumped on
> my c: drive when I installed a demo. Is it useful? Safe? Worth
> investigating
Use WSH (VBS VisualBasicScript). A whole setup of it got dumped on your
machine when you installed your operating system. It's universal in Windows.
Useful. Safe. Worthwhile.
> @echo off
> setlocal
> echo. @PROMPT e0'SET UTOO='$_rcx$_9$_w0$_q>.\UTOO.BAT
> %COMSPEC% /c .\UTOO.BAT|debug .\UTOO.BAT
> cd>>.\UTOO.BAT
> for %%s in (CALL DEL) do %%s .\UTOO.BAT
> set PATH=%UTOO%;%PATH%;
> editor.exe
...
> that's got a lot of stuff
> that's new to me. Powerful, too.
FOR...DO is very powerful, especially nested FOR...DOs.
> "Setlocal" triggers a "Bad command or
> file name" under 9x (no problem when run from a kmd prompt though, so I
> assume it's an NT call?)
Yes. I always use KMD.EXE for BATch files in 9x. You can't use tokens or
delimiters otherwise. You can't use counters. Take a look at U2UTL9x.BAT.
SETLOCAL isn't really necessary here, though, because whatever changes you
impose on the environment while KMD is running are obliterated when KMD
terminates (that's why SETLOCAL isn't necessary).
> it works as expected.
I know. This is 1980s stuff: pipe DEBUG commands into DEBUG.COM and write a
file. Here we write (">") a 9-byte BAT file that has no terminal carriage
return ("SET UTOO="), then we append (">>") a CD command to it, so the result
is "SET UTOO=D:\XY4{carriage return}" or whatever, on one line. Then we
perform a DO...FOR that first runs (CALLs, so that UTOO.BAT is treated as a
subroutine that returns to the parent on termination of its single line) the
BATfile (it SETs environment variable %UTOO%) and second DELetes the
UTOO.BATfile. It actually IS very simple!
-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------