Link to home
Start Free TrialLog in
Avatar of codeconqueror
codeconqueror

asked on

How to disable changing the system date/time programmatically using VB

Does anyone know how to disable the user from changing the system's date and time.  I know it can be done via policy, but I can't use that in this situation.  My program applies different rights to the system in real-time when the user logs into my program (but all the while only 1 user is logging in to Windows).  I can control almost everything about the system, but this one user right is giving me trouble.  I know how to refresh the policy once the registry has been changed, but I can't figure out which registry entries to change and to what.  Any help would be appreciated.  Thanks.
SOLUTION
Avatar of fostejo
fostejo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Have you check

run gpedit.msc

Local Computer Policy->Computer Configuraton->Windows Settings
->Security settings->local policies->user rights assignment

change the system time
Avatar of codeconqueror
codeconqueror

ASKER

eddykt -> I know I can via gpedit, but I need to do this programatically and with only 1 windows user.  They log in to windows, open my program and log into my program.  When they log into my program, I setup their Windows user rights based on the settings the admin entered into my software (no desktop, no date/time change, no start button, etc...).

fostejo ->  I have tried to rename the file, but XP magically pulls it back.  I renamed it from TimeDate.cpl to TimeDate.xxx and watched XP re-copy the file after about 20 seconds.

Anyone have any other ideas?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
errr, not so big a fan of that one Eddykt.  I did figure out the following though (from http://www.kellys-korner-xp.com/xp_tweaks.htm):

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"HideClock"=dword:00000001

[HKEY_CURRENT_USER\Control Panel\don't load]
"timedate.cpl"="No"


By making these changes, and disabling access to the control panel (I already had that in the program), I got the effect I wanted.  I'll just make the Date/Time right a sub-right of access control panel.  Thanks for your help guys.