Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4363
  • Last Modified:

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.
0
codeconqueror
Asked:
codeconqueror
  • 2
  • 2
2 Solutions
 
fostejoCommented:
codeconqueror,

Ummm.. Interesting one - can't track down the appropriate registry entries either.. but, a couple of ways would be;

1. Remove the Read permissions (or explicity deny access) for the user to the physical timedate.cpl applet itself using cacls.exe for instance.
2. Rename the file!!

hope that helps somewhat...
cheers,
0
 
EDDYKTCommented:
Have you check

run gpedit.msc

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

change the system time
0
 
codeconquerorAuthor Commented:
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?
0
 
EDDYKTCommented:
>>I renamed it from TimeDate.cpl to TimeDate.xxx and watched XP re-copy the file after about 20 seconds.

http://www.experts-exchange.com/Operating_Systems/WinXP/Q_20977948.html
0
 
codeconquerorAuthor Commented:
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.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now