PWB Startup for all users aside from one
Moderators: Tyler, Scott, PWB v2 Moderator
PWB Startup for all users aside from one
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?
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
Similar to starting PWB in the third post in the following thread.
http://www.teamsoftwaresolutions.com/ph ... .php?t=536
--Scott
Thanks
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.
Here is an example based on the other example to run PWB for everyone except the user "summer".
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
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
--Scott
Last edited by Scott on Fri May 07, 2010 6:54 am, edited 1 time in total.
Of course you could have reversed it as well.
--Scott
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.