Jump to content
Sign in to follow this  
johnmcloud

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

Share this post


Link to post
Share on other sites

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".

Share this post


Link to post
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

Share this post


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
Sign in to follow this  

  • Similar Content

    • By joseLB
      Hi
      This piece of code creates and reads OK a key at  "HKEY_LOCAL_MACHINE" and can be changed for a key at "HKEY_CURRENT_USER"
      $sta= RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor", "wav", "REG_SZ", "5555") MsgBox(4096,"wrote", $sta &@cr& @error) $zz= RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor", "wav") MsgBox(4096,"readed","="&$zz &@cr& @error) Exit With  HKEY_CURRENT_USER, in RegEdit we can see the created key, and we can create the key by hand/RegEdit and everything Works OK.
      At  HKEY_LOCAL_MACHINE we can´t see the created key above  thru RegEdit, but it Works (even not seeing, I can read). But  if I create "by hand"/RegEdit  the key,  it can´t read it with   $zz= RegRead  ("HKEY_LOCAL_MACHINE.... above.
      I´m the PC´s WIN.7 administrator. Even so I ran RegEdit as administrator and also the compiled AU3 and also plain. No changes.
      edit: even if Try   "HKEY_LOCAL_MACHINE\SOFTWARE\AAA", "wav", the same holds true.
      $sta= RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\AAA", "wav", "REG_SZ", "4444") MsgBox(4096,"wrote", $sta &@cr& @error) $zz= RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\AAA", "wav") MsgBox(4096,"readed","="&$zz &@cr& @error) Exit Seems that it creates this key at another place.... I can read the above value ("4444"), even after a boot, even the key not showing in regedit. And if I create it by hand key AAA/wav with a distinct value (666), t, it continues Reading the old value = 444.
      Thanks
      Jose
       
    • By Elrond5
      So I want to remap Capslock to Ctrl using Autoit
      ;3A00 = Caps ;1D00 = Ctrl RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout","Scancode Map","REG_BINARY","000000000000000002000000E0473A0000000000") However it isn't doing anything. And I have no idea why my code doesn't work.
    • By antonioj84
      Hi all to the forum guru and expert I am trying to  automate this. in the registry  I have the network profile name network 2 and network   I want to  change their  CATEGORY  to Private .  Can someone lead me in the right direction.
      Private is 1 and Public is 0
      #RequireAdmin Global $sHKLMRoot = @OSArch = "x64" ? "HKLM64" : "HKLM" RegWrite($sHKLMRoot &"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" ,'/v NetworkList /t REG_MULTI_SZ /d 00000000 /f') see  attached picture below
      Much appreaciate
       

    • By damon
      I am having an issue with windows 10 and regwrite.  when i run my script it acts as though it has updated the registry but when i view the registry it has not updated the keys.  I added error checking to the script but it is not showing errors.  now if i remove #requireadmin i will get error 1 - unable to open requested key.
      her is my code.
       
      #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <Process.au3> ; Declared Variables Global $userName = "user" Global $userPassword = "Ktesting" Global $autologin = "1" Global $notification = "0" Global $balloon = "0" If @OSArch = "X64" Then Global $HKLM = "HKLM64" Else Global $HKLM = "HKLM" EndIf ; Looks for switch on program start If $CmdLine[0] > 0 Then ; looks for switch on startup If $CmdLine[1] = "/boot" Then BootMachine() Else MachineInstallation() EndIf ; Setup Kiosk for first time Func MachineInstallation() #RequireAdmin MsgBox (1, "Installation", "Starting Install") ; Add Program to Run registry Key RegWrite ($HKLM & "\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "DL Kiosk", "REG_SZ", "c:\temp\DL Testing Kiosk\dl testing kiosk.exe /boot") If @error Then MsgBox (1, "error", @error) EndIf ; Add Automatic Logon Registry Key RegWrite ($HKLM & "\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", $autologin) If @error Then MsgBox (1, "error", @error) EndIf RegWrite ($HKLM & "\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", $userName) If @error Then MsgBox (1, "error", @error) EndIf RegWrite ($HKLM & "\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", $userPassword) If @error Then MsgBox (1, "error", @error) EndIf ; Pop Ups and Notification Center Registry RegWrite ("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableNotificationCenter", "REG_SZ", $notification) If @error Then MsgBox (1, "error", @error) EndIf RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "EnableBalloonTips", $balloon) If @error Then MsgBox (1, "error", @error) EndIf MsgBox (1, "Installation", "Install completed") EndFunc Exit  
      EDIT:
      i think i figured out my problem.  I was missing the space between Windows and NT.  user error, sorry.  
    • By Leo1906
      Hello guys,
      I'm having a problem right here ..
      I was trying to create a few Registry Values using autoit, but it seems to me that Autoit can't write those values to this specific part of the registry ..
      Here is the code I'm trying to run:
      RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\test\command", "", "REG_SZ", "C:\test\convert.exe %1 geojson|convert") I'm definitly sure that the path is correct. Script is runned with Admin Rights. Everything's fine here.
      It's possible to read other values stored by Windows in this directory:
      MsgBox(0, 0, RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.burn", "Description")) But you can't edit those using Autoit. I don't know what this is. In my eyes it's an Autoit Bug or something like that ...
      Possible solution for me is to write a ".reg" file and run it afterwards, but this is an unclean method I don't really want to use ..
      Any suggestions on this?
       
      Edit: the OS is Windows 7 x64 German Language btw ..
×
×
  • Create New...