hi, am a novice with excel vb. with a .vbs file attempt, will probably need a working example thanks. (trying to get line spacing to work here..)
i have a .vbs file i paste directly to desktop, to toggle setting for hide file name extensions that does work. It does not refresh the desktop and explorer (on the first click of the file), the same as if set it manually (as below). I need help with the refresh portion.
i have an example of the .vbs file using:
MANUAL SETTING: (of hide extension: gets you 1 free refresh of desktop & explorer)
explorer, tools, options, view, check box for: hide extensions for known file types (that item auto updates both the desktop & the windows explorer).
i would like to incorporate that into my script. same basic idea: my script to a text / .vbs file so i can click in on my desktop (as a toggle, ie 1 click turns it on, the next click turns it off; got that/ it works), i need to add to it to spawn a refresh same as, or equivalent for both: desktop & explorer).
paste the following to a text file (or equivalent that will make same result):
FileExt = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt"
Set Sh = WScript.CreateObject("WScript.Shell")
St = Sh.RegRead(FileExt)
If St = 1 Then
Sh.RegWrite FileExt, 0, "REG_DWORD"
Else
Sh.RegWrite FileExt, 1, "REG_DWORD"
End If
Sh.SendKeys("{F5}")
rename the text file to: HIDE EXT.vbs instead of .txt, and pasting it to the desktop.
WHAT NEED:
what i need added to it is the refresh of the desktop & the explorer window(s). same as when making the setting manually. the F5 here does not seem to be working on the first time around. on 2nd click of file, it works to send view to opposite of that for which view "state" is actually in.
Hope this could help:
Instead of
Try using:
It works fine with me. (I'm using XP and windows server 2003)
I found out that F5 key won't simply work as the same as Desktop, right-click, then click refresh. I referred my code here: http://en.kioskea.net/faq/7789-batch-script-to-automatically-reload-explorer-exe