Jump to content

I Need Help In This Code


Recommended Posts

  • Moderators

Hi, shata. There are several registry keys that handle the windows time. I would suggest opening your registry and doing a Find for time.nist.gov, making note of the registry keys. Then, have a look at RegWrite in the help file.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

For some odd reason this writes to an entirely diffrent key for me... but its the value i need to edit atleast on windows 7 ultimate 64.

it seems to edit, HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionDateTimeServers.

No idea why it does this ;)

$i=0
$done=0
Do
   $i=$i+1
   $read=_RegRead($i)
   If $read = "time.nist.gov" Then
   _RegWrite("", $i)
$done=1
   EndIf
Until $done=1

Func _RegRead($Key)
$Read=RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionDateTimeServers", $Key)
Return $Read
EndFunc

Func _RegWrite($Key, $Value)
RegWrite("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionDateTimeServers", $Key, "REG_SZ", $Value)
EndFunc
Edited by AdamSwe
Link to post
Share on other sites

Hi, shata. There are several registry keys that handle the windows time. I would suggest opening your registry and doing a Find for time.nist.gov, making note of the registry keys. Then, have a look at RegWrite in the help file.

Thanks man I Like Your Post

For some odd reason this writes to an entirely diffrent key for me... but its the value i need to edit atleast on windows 7 ultimate 64.

it seems to edit, HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionDateTimeServers.

No idea why it does this ;)

$i=0
$done=0
Do
   $i=$i+1
   $read=_RegRead($i)
   If $read = "time.nist.gov" Then
   _RegWrite("", $i)
$done=1
   EndIf
Until $done=1

Func _RegRead($Key)
$Read=RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionDateTimeServers", $Key)
Return $Read
EndFunc

Func _RegWrite($Key, $Value)
RegWrite("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionDateTimeServers", $Key, "REG_SZ", $Value)
EndFunc

Thank You A lot man It's Work With Me
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...