PWB Startup for all users aside from one

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
supertan
Observer
Observer
Posts: 4
Joined: Wed Sep 09, 2009 8:52 am

PWB Startup for all users aside from one

Post by supertan »

Hi, I've got the shortcut to PWB in the all users startup folder on some kiosk machines but was wondering if you knew of a way of preventing it from starting up at login for a specific user account?

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

Sure. Take the shortcut out of the All User Startup folder, and place a string value in the HKEY_LOCAL_MACHINE Run key that points to a batch file that checks the user name and starts PWB if the name is not the target name.

Similar to starting PWB in the third post in the following thread.
http://www.teamsoftwaresolutions.com/ph ... .php?t=536

--Scott

supertan
Observer
Observer
Posts: 4
Joined: Wed Sep 09, 2009 8:52 am

Thanks

Post by supertan »

Thanks for your reply. I can see the logic in getting the run key in the registry to point to the batch file. The batch file in the example you linked to is to lock down a specific user. I don't quite understand how I am supposed to let PWB run for everyone aside from 1 specific user. Sorry if I'm being silly. :oops:

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

Here is an example based on the other example to run PWB for everyone except the user "summer".

Code: Select all

REM turn the echo off and clear the screen 
@ECHO OFF 
CLS 

REM Check for user and lock down 
IF /i NOT %username% == summer GOTO LockDown 

REM No lock down 
ECHO You are free to go. 
GOTO End 

:LockDown 
ECHO Locking you down 
START C:\PWB\PWB.exe 
GOTO End 

:End 
ECHO Have fun. 
Exit 
Notice the use of NOT. Also be aware the name is case sensitive so I added a "/i" to the IF. You could also check the environment variables with the SET command and match the case.

--Scott
Last edited by Scott on Fri May 07, 2010 6:54 am, edited 1 time in total.

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

Of course you could have reversed it as well.

Code: Select all

REM Check for user and lock down 
IF %username% == summer GOTO NoLockDown 

REM lock down
ECHO Starting PWB. 
START C:\PWB\PWB.exe 
GOTO End 

:NoLockDown 
ECHO Hi summer. 
GOTO End 

:End 
ECHO Have fun.
--Scott

Post Reply