Need to use a regex in a "for" loop.

samintz

Scott Mintz
May 20, 2008
1,369
12
Solon, OH, USA
Well, since you said that DIR works correctly, then use this syntax:

for /f %I in ('dir /b ::\.[A-z]{1}[0-9]{7}.pdf') do copy %I ehs-%I

-Scott

pb4072 <> wrote on 07/28/2008 08:30:38 AM:


> Nope. Sorry. None of these solutions work. I get nothing. I just
> tried it with a simple "echo." I guess I'll make a batch file and use
"do."

>
> for %I in ("::\.[A-z]{1}[0-9]{7}.pdf") do copy %I ehs-%I
> for %I in ("::"\."[A-z]{1}[0-9]{7}.pdf") do copy %I ehs-%I
>
> -Peter
>
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 09:00:42 -0500, Jay Sage <> wrote:


>I tried loading the QBAT plugin. When I execute QBAT, a task opens but I
>see nothing on the screen and can recover only by killing the TCC task
>in which QBAT was run.
Are you using TCMD? I haven't even considered that yet.

QBAT should position itself so its top edge is at the console's bottom edge.

There's a newer one on the FTP site.
 
Jun 2, 2008
298
1
Newton, MA
> Are you using TCMD?

Yes.

> QBAT should position itself so its top edge is at the
> console's bottom edge.

That was the problem. My TCMD window was aligned with the
bottom of the screen, so the dialog could not be seen.

Could you add a slash option to specify where the window
should open?

-- Jay
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 09:41:07 -0500, Jay Sage <> wrote:


> > QBAT should position itself so its top edge is at the
> > console's bottom edge.
>
>That was the problem. My TCMD window was aligned with the
>bottom of the screen, so the dialog could not be seen.
>
>Could you add a slash option to specify where the window
>should open?
I could add options to do a lot of things but that'll just make it harder to
use. I could also get prefs from a [QBAT] section in the INI file. Either is
some time away.

Things I could customize with options or INI directives:

position
size (nope!, too hard with a dialog box & controls)
tab stops (actually CtrlTab stops; using 2 chars now)
font (using Courier New/7 now)
give foreground to console upon run
 
May 30, 2008
122
1
On 28/07/2008, vefatica <> wrote:

> On Mon, 28 Jul 2008 09:41:07 -0500, Jay Sage <> wrote:
> > > QBAT should position itself so its top edge is at the
> > > console's bottom edge.
> >
> >That was the problem. My TCMD window was aligned with the
> >bottom of the screen, so the dialog could not be seen.

> I could add options to do a lot of things but that'll just make it harder to
> use. I could also get prefs from a [QBAT] section in the INI file. Either is
> some time away.
Silly question, but what's wrong with

START /WAIT notepad xxx.bat & xxx.bat & del /q xxx.bat

if you just want to use a temporary batch file (edit to insert your
editor of choice here, of course).

Generally, I *don't* want a batch file for "simple one-liner" stuff
like this, but that's a different matter...

Paul.
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 10:36:16 -0500, "p.f.moore" <> wrote:


>Silly question, but what's wrong with
>
>START /WAIT notepad xxx.bat & xxx.bat & del /q xxx.bat
>
>if you just want to use a temporary batch file (edit to insert your
>editor of choice here, of course).
Notepad doesn't have a "Run" button. Try it. I find it quite useful.
 
Jun 2, 2008
298
1
Newton, MA
> Silly question, but what's wrong with
>
> START /WAIT notepad xxx.bat & xxx.bat & del /q
> xxx.bat
>
> if you just want to use a temporary batch file (edit
> to insert your editor of choice here, of course).

The QBAT command allows one to test out versions of the complex command
without having to start from scratch each time. I often put ECHO in
front of the looped command to make sure that the right command lines
are being generated. When I'm satisfied, I then remove the ECHO. Vince's
plugin makes this easy to do (SAVE/RUN).

I am often interested in writing one-time complex commands, and I think
I will find this plugin very useful.

-- Jay
 
Jun 2, 2008
298
1
Newton, MA
> I could add options to do a lot of things but that'll
> just make it harder to use.

But being able to position the dialog box so that it appears on the
screen is CRITICAL.

For some reason, it now appears just above the bottom of the TCMD or TCC
window, so I can grab the bar and move it into view. But that's a real
annoyance.

-- Jay
 
May 29, 2008
47
0
Orion Arm, MWG
FireFox 2.0.0.15. The image is the size of my desktop. Is there a way to get FF to show it un-scaled and with scrollbars?
It was properly scaled in 2.0.0.16. Clicking on it toggled back and forth between shrunken and full-sized displays as is usually the case.

(Note my version number. It has nothing to do with your issue but I though it was worth mentioning.)
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 11:18:17 -0500, Jay Sage <> wrote:


>But being able to position the dialog box so that it appears on the
>screen is CRITICAL.
OK, you can put something like this in your INI file (make sure you get the
right INI file).

[QBAT]
Xpos=200
Ypos=200
FontName=Courier New
FontSize=14
TabSpec=8

The defaults are:

pos: centered horizontally, just below the console
font: Courier New / 14
tabspec: 8 (these are not characters; with CourierNew14, 8 gives 2 chars,
experiment)

New one: ftp://lucky.syr.edu/4plugins/qbat.dll
 
May 30, 2008
122
1
2008/7/28 vefatica <>:

>>But being able to position the dialog box so that it appears on the
>>screen is CRITICAL.

> OK, you can put something like this in your INI file (make sure you get the
> right INI file).
Nice! I can see a million and one enhancements, though :-) The big one
that comes to my mind is to allow the bat file to be named (and to be
somewhere other than the current directory).

Oh, and shouldn't "Exit" remove the bat file? After all, there's a
"Save/Exit" button to keep it... (I'd much rather the command delete
the file, I don't like "temporary" files like this getting left
around).

Paul
 
Jun 2, 2008
298
1
Newton, MA
> you can put something like this in your INI file
> (make sure you get the right INI file).

What do the X and Y coordinates mean? I had expected them to be absolute
screen coordinates, but I tried setting them both to 100, and the window
opens well below the bottom of the TCC window. Are they relative to your
default location?

Also, when is the INI file read? Can I change the INI file and then
invoke QBAT with the new settings? Or do I have to unload and reload the
plugin? Or exit TCMD/TCC and start up again?

-- Jay
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 15:00:05 -0500, "p.f.moore" <> wrote:


>Nice! I can see a million and one enhancements, though :-) The big one
>that comes to my mind is to allow the bat file to be named (and to be
>somewhere other than the current directory).
You can supply a [path\]filename (existing or not) on the command line; it's the
only command line option. Actually, you can supply any name ... if it's not a
BAT, BTM, or CMD you'll get an error message when QBAT tries to run it. The
file size limit is 32KB.


>Oh, and shouldn't "Exit" remove the bat file? After all, there's a
>"Save/Exit" button to keep it... (I'd much rather the command delete
>the file, I don't like "temporary" files like this getting left
>around).
I feel differently. If I spent a lot of time getting a complicated command
right I want a record of it. And I might want to use QBAT later, continuing
earlier work. I could make it an INI option to delete QBAT.BAT but I don't
think that's a good idea for a user-named file.
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 15:17:01 -0500, Jay Sage <> wrote:


>What do the X and Y coordinates mean? I had expected them to be absolute
>screen coordinates, but I tried setting them both to 100, and the window
>opens well below the bottom of the TCC window. Are they relative to your
>default location?
They're the usual screen coordinates. 100,100 was my test case (which worked).
Did you get the right INI file? I didn't at first.

>
>Also, when is the INI file read? Can I change the INI file and then
>invoke QBAT with the new settings? Or do I have to unload and reload the
>plugin? Or exit TCMD/TCC and start up again?
It will get the new settings. Everything is done when the dialog gets the
WM_INITDIALOG message.
 
Jun 2, 2008
298
1
Newton, MA
> [QBAT]
> Xpos=200
> Ypos=200

This doesn't seem to be working for me at all (and I did download the
new version using your link -- maybe I should try again using my FTP
client).

I'm editing the INI file using "edit %_ininame". That should get the
right file, no? It is TCMD.INI.

-- Jay
 
Jun 2, 2008
298
1
Newton, MA
QBAT is definitely not reading the INI file. Are you sure that you
uploaded the correct new version? The one on your server has a time
stamp of 10 o'clock this morning. That doesn't sound like a new version.

-- Jay
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 15:39:58 -0500, Jay Sage <> wrote:


>QBAT is definitely not reading the INI file. Are you sure that you
>uploaded the correct new version? The one on your server has a time
>stamp of 10 o'clock this morning. That doesn't sound like a new version.
I guess I goofed.

There's a new one there now.
 
Jun 2, 2008
298
1
Newton, MA
> There's a new one there now.

What a difference that made!!! Now it's working fine. Thanks.

-- Jay
 
May 30, 2008
122
1
2008/7/28 vefatica <>:

>>Nice! I can see a million and one enhancements, though :-) The big one
>>that comes to my mind is to allow the bat file to be named (and to be
>>somewhere other than the current directory).

> You can supply a [path\]filename (existing or not) on the command line; it's the
> only command line option. Actually, you can supply any name ... if it's not a
> BAT, BTM, or CMD you'll get an error message when QBAT tries to run it. The
> file size limit is 32KB.
Thanks. That's ideal.


>>Oh, and shouldn't "Exit" remove the bat file? After all, there's a
>>"Save/Exit" button to keep it... (I'd much rather the command delete
>>the file, I don't like "temporary" files like this getting left
>>around).

> I feel differently. If I spent a lot of time getting a complicated command
> right I want a record of it. And I might want to use QBAT later, continuing
> earlier work. I could make it an INI option to delete QBAT.BAT but I don't
> think that's a good idea for a user-named file.
I don't dispute the value of save & exit, I'm just not sure why you
have both Save/Exit and Exit if they both do the same...

(Hmm, I see that Exit does discard changes that haven't yet been
saved. So I see the difference now, but I'm not entirely sure how
useful the distinction is. Never mind, it's certainly not important
enough that I'd make a fuss about it).

Paul.
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 17:30:55 -0500, "p.f.moore" <> wrote:


>> I feel differently. If I spent a lot of time getting a complicated command
>> right I want a record of it. And I might want to use QBAT later, continuing
>> earlier work. I could make it an INI option to delete QBAT.BAT but I don't
>> think that's a good idea for a user-named file.

>I don't dispute the value of save & exit, I'm just not sure why you
>have both Save/Exit and Exit if they both do the same...
>
>(Hmm, I see that Exit does discard changes that haven't yet been
>saved. So I see the difference now, but I'm not entirely sure how
>useful the distinction is. Never mind, it's certainly not important
>enough that I'd make a fuss about it).
And I see your point. What if "Exit" saved by default and "Save/Exit" were
changed to "Delete/Exit" (or something like that)?

I added a command line option:

QBAT [/D(elete on exit)] [filename]

/D, happens after the dialog, when QBAT is returning. The file is
unconditionally deleted.

New file in place on lucky.syr.edu.
 
Jun 2, 2008
298
1
Newton, MA
Vince,

Is there command-line help for QBAT? As the options increase, it will be
helpful to have a syntax message (/?).

-- Jay
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Mon, 28 Jul 2008 19:53:36 -0500, Jay Sage <> wrote:


>Is there command-line help for QBAT? As the options increase, it will be
>helpful to have a syntax message (/?).
I'm working on that right now. I just uploaded a new one.
 
May 30, 2008
122
1
2008/7/29 vefatica <>:

> And I see your point. What if "Exit" saved by default and "Save/Exit" were
> changed to "Delete/Exit" (or something like that)?
That would suit me. (I can see others being glad of the "throw away
the local changes and exit" behaviour, so don't do it just on my
say-so, though!)


> I added a command line option:
>
> QBAT [/D(elete on exit)] [filename]
>
> /D, happens after the dialog, when QBAT is returning. The file is
> unconditionally deleted.
>
> New file in place on lucky.syr.edu.
That sounds really good. Thanks for this.

Paul.