Re: If username = stuff

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Mark Coutinho (mark_at_soaaids.nl)
Date: 12/23/04


Date: Thu, 23 Dec 2004 13:39:57 +0100

Hi Matthias,

I made some changes for my batch, but I can't get the last thing
right.

This is what I got:

@echo off&setlocal
setPB=F:\PUBLIC\Uitrollen\Printersverbinden\AllePrintersVerbindenKleur.bat
set P2=F:\PUBLIC\Uitrollen\Printersverbinden\AllePrintersVerbinden.bat
set Users= petra berry
for %%A in (%Users%) do if /I "%USERNAME%" EQU "%%A" set PB=%PB%
call %P2%

(in the original there is a space between 'set' and 'PB' (i.e. set PB,
but I can't get it right in my Free Agent mail)
Now what has to happen is: if Berry or Petra is the one who's logging
in they have to 'use' PB
If anyone else is logging in they have to call P2.

But no matter how I puzzle with the last two lines of the batch I
never get i right.

Could you help me once more, please?

Thanks!

On Mon, 20 Dec 2004 15:24:45 +0100, Matthias Tacke <Matthias@Tacke.de>
wrote:

>Mark Coutinho wrote:
>> My batch looks like this right now
>>
>> @echo off&setlocal
>> set PB=f:\public\AllePrintersVerbindenKleur.reg
>> set P2=f:\public\AllePrintersVerbinden.reg
>> set Users=petra berry wilma rose-marie
>> for %%A in (%Users%) do if /I "%USERNAME%" EQU "%%A" set PB=%P2%
>> call %PB%
>>
>> It's about the .reg entry's
>> I know I said I wanted to call batches, but is it possible to execute
>> these registry-entries instead? Of course it is, but how would the
>> lines be then?
>>
>> So the 5 users will get a colorprinter in their printer-registry-key
>> and all the others get the other registry entry which does not have a
>> colorprinter in it.
>>
>You could use reg.exe (included in xp, for w2k in the resource Kit)
>to integrate the settings directly, or use start xyz.reg to install
>the reg file. Type reg /? in a cmd window.
>
>Depending on your environment there should be other/better ways to
>set default/allowed printers.
>
>HTH



Relevant Pages

  • Re: WSUS 3.0 client computers not populating WSUS console
    ... then you can try the batch provided. ... "Jorge Silva" wrote: ... net start wuauserv ...
    (microsoft.public.windows.server.active_directory)
  • Re: If username = stuff
    ... > My batch looks like this right now ... > @echo off&setlocal ... > and all the others get the other registry entry which does not have a ... the reg file. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: WGET
    ... BTW, when running this how do you keep it running after logging out, ... throw into the background as independent process ... Create a command procedure and submit it to batch? ...
    (comp.os.vms)
  • strange issue: not read read receipts being sent out
    ... I have a strange issue with my Exchange setup, I have one user who, ... when logging on or off of the domain is sending out a batch of not ... The read receipts are only being sent to the one same user everytime. ... is definitely connected to this user logging off and on to the domain. ...
    (microsoft.public.exchange.admin)