Re: How to communicate with a batch file
From: Bob Altman (rda_at_nospam.com)
Date: 05/09/04
- Next message: mayayana: "Re: re:vb.net?"
- Previous message: isaac rainsford (MCSE): "how to set NTFS permissions using GetNamedSecurity and SetNamedSecurityInfo"
- In reply to: Bob Altman: "Re: How to communicate with a batch file"
- Next in thread: Fosco: "Re: How to communicate with a batch file"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 9 May 2004 09:21:23 -0700
Uhhh... Never mind. I found the one-line reference to the double-% magic
buried in the help text that comes back when I type HELP FOR at a command
line prompt.
Thanks again for all the help!
- Bob
"Bob Altman" <rda@nospam.com> wrote in message
news:OfO5$0dNEHA.700@TK2MSFTNGP10.phx.gbl...
> Thanks Torgeir, that exactly what I'm looking for! What's the deal with
the
> double-% syntax (%%a) in your sample? More to the point, where can I find
> documentation on that sort of magic?
>
> - Bob
>
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
> news:O5vqbjVNEHA.636@TK2MSFTNGP10.phx.gbl...
> > Bob Altman wrote:
> >
> > > When I invoke reg.exe, it spits out a bunch of stuff to StdOut
> (including
> > > some blank lines, a banner line, and a line that contains the key
name,
> > > type, and value). I can't find a way to ask reg.exe to just give me
the
> > > value string in a form that my batch file can easily consume it.
> > Hi
> >
> > Try this batch file, it should report the country you have set
> > your computer to under Control Panel/International (note: the
> > 'for ...' line might be wrapped over two lines by the newsreader,
> > in that case, unwrap it):
> >
> > @echo off
> > set regvaluedata=
> > set regkey="HKCU\Control Panel\International"
> > set regvalue="sCountry"
> > :: line above for command (line might wrap)
> > for /f "Skip=4 Tokens=3" %%a in ('REG.EXE QUERY %regkey% /v %regvalue%')
> do set regvaluedata=%%a
> > :: line under for command
> > echo %regvaluedata%
> > pause
> >
> >
> > --
> > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> > Administration scripting examples and an ONLINE version of
> > the 1328 page Scripting Guide:
> > http://www.microsoft.com/technet/community/scriptcenter/default.mspx
>
>
- Next message: mayayana: "Re: re:vb.net?"
- Previous message: isaac rainsford (MCSE): "how to set NTFS permissions using GetNamedSecurity and SetNamedSecurityInfo"
- In reply to: Bob Altman: "Re: How to communicate with a batch file"
- Next in thread: Fosco: "Re: How to communicate with a batch file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|