johnmcloud Posted May 2, 2013 Posted May 2, 2013 (edited) 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 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 May 2, 2013 by johnmcloud
Moderators JLogan3o13 Posted May 2, 2013 Moderators Posted May 2, 2013 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!
johnmcloud Posted May 2, 2013 Author Posted May 2, 2013 (edited) 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/ChangeplusRegistryplusSettingsplusandplusBroadcastorhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/120b3b33-0e50-4d37-844f-f768494e4aaeorhttp://vbcity.com/forums/t/153929.aspxOr again using COM ( another unknown language )http://stackoverflow.com/questions/2488727/refresh-windows-explorer-in-win7Seems there are many ways, but using autoit? Edited May 2, 2013 by johnmcloud
johnmcloud Posted May 2, 2013 Author Posted May 2, 2013 I have found something work:So, i think is solved but i need to thest it with seven, now i'm on xp
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now