Jump to content

Refresh a "RegWrite"


Recommended Posts

Hi guys ;)

For a script i need to show extension ( if is not enabled by default ) and the restore the original value after my function.

The script:

Global $Ini = @ScriptDir & "\Test.ini"

FileExt("Show")
Sleep(5000)
FileExt("Default")

Func FileExt($parameter)
Local $RegKey = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt")
Local $SaveKey = IniRead($Ini, "Data", "HideFileExt", "")
If $parameter = "Show" And $SaveKey = 1 Then
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", 0)
EndIf
If $parameter = "Default" Then
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", $SaveKey)
EndIf
EndFunc ;==>FileExt

The problem is i can't see any difference :D

I have try to send F5 ( and press F5 on my keyboard ) but nothing. The only thing work is click with the mouse left on the desktop/folder --> Refresh

There is an equivalent for my script?

Thanks as always ;)

Edited by johnmcloud
Link to comment
Share on other sites

  • Moderators

Hi, johnmcloud, maybe I am missing something, but you call FileExt("Enable") - However in your function, you have an If statement If $parameter = "Show", not "Enable". So the only portion that will ever run is the "Default".

"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 comment
Share on other sites

Hi, sorry was a copy-paste error in the forum, but the problem is always the same ;)

EDIT: Maybe this can help? I don't understand it but someone maybe can:

http://www.codeproject.com/Tips/205472/ChangeplusRegistryplusSettingsplusandplusBroadcast

or

http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/120b3b33-0e50-4d37-844f-f768494e4aae

or

http://vbcity.com/forums/t/153929.aspx

Or again using COM ( another unknown language :D )

http://stackoverflow.com/questions/2488727/refresh-windows-explorer-in-win7

Seems there are many ways, but using autoit?

Edited by johnmcloud
Link to comment
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
 Share

×
×
  • Create New...