Gizmos Freeware Reviews  

Go Back   Gizmo's Freeware Forum > Freeware Forum > General Computer Support

Reply
 
Thread Tools Display Modes
Old 30. Jun 2014, 11:52 PM   #1 (permalink)
Senior Member
 
sicknero's Avatar
 
Join Date: Mar 2012
Location: England
Posts: 657
Default Curious effect of "show/hide" vbs scripts in Windows

On both my laptop and desktop PCs (running W7 Ultimate x86), I have three vbs scripts which I use to quickly toggle "Show Thumbnails", "Show Hidden Files, Folders and Drives", and "Hide Protected Operating System Files". The scripts are triggered from my Windows context menu so that I can toggle those settings easily without having to faff around in Tools - Folder Options.

Also, I use a separate system tray program that provides an OSD to notify me if my numlock or capslock keys are triggered.

Okay. The curious thing then, is that triggering any of the vbs scripts also triggers the OSD numlock notification and also appears to randomly switch the numlock state itself from time to time, which needless to say is a little inconvenient.

I've tried half a dozen different numlock OSD programs and the same thing happens with all of them. I've also tried a couple of different vbs scripts (downloaded) but they have the same behaviour too.

I've looked at the scripts but I don't know much about how they work so I can't understand why they are triggering the OSD. Also I can't seem to find a regular pattern ... usually the OSD will be triggered without changing the state of the key but occasionally, the state will be changed by the vbs. Lastly I've tried disabling the numlock key entirely but even this doesn't seem to help.

I was just wondering if anyone here is knowledgable enough about vbs to help me work out why this is happening and to fix it, or perhaps, if anyone knows of some alternative way I can have these enhancements (OSD for numlock/capslock and and a quick way to toggle thumbnails and hidden files/folders).

I hope all that made sense : ) Cheers.
sicknero is offline   Reply With Quote
Old 01. Jul 2014, 12:31 AM   #2 (permalink)
Senior Edtor
 
v.laurie's Avatar
 
Join Date: Jul 2010
Posts: 1,380
Default

I used to write VBS scripts a few years back. Unfortunately, my VBS skills are pretty rusty but I can take a look at your scripts if you'd like. There is another factor. Context menu entries are written in the Registry. I assume it is a command from the Registry that invokes the scripts. So there may be some sort of Registry problem. Do you know what Registry key(s) are involved?
__________________
Vic
v.laurie is offline   Reply With Quote
Old 01. Jul 2014, 10:43 AM   #3 (permalink)
Senior Member
 
sicknero's Avatar
 
Join Date: Mar 2012
Location: England
Posts: 657
Default

Hi, thanks very much for your response.

I forgot to mention that I did consider whether it was the context menu entry (as you thought it is a registry edit, just a couple of additions to HKCR\Directory\Background\Shell\) but it makes no difference whether the script is triggered from the context menu or by running it directly so I don't think that's the problem.

Here's one of the scripts that I've tried (from VishalGupta at Askvg.com).

Hidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Ex plorer\Advanced\Hidden"
SHidden = "HKCU\Software\Microsoft\Windows\CurrentVersion\Ex plorer\Advanced\ShowSuperHidden"
Set Sh = WScript.CreateObject("WScript.Shell")
St = Sh.RegRead(Hidden)
If St = 2 Then
Sh.RegWrite Hidden, 1, "REG_DWORD"
Sh.RegWrite SHidden, 1, "REG_DWORD"
Else
Sh.RegWrite Hidden, 2, "REG_DWORD"
Sh.RegWrite SHidden, 0, "REG_DWORD"
End If
Sh.SendKeys("{F5}")

As I say, I've tried a couple from different sources but as far as I can tell the only differences are in construction rather than content and they all seem to have the same issue.

If you're inclined to see if you can duplicate this yourself, here are links to three of the OSD programs that I've tried. They're all portables and shouldn't make any changes to your O/S (although I think Wireless Keyboard Notifier has autorun set in the ini by default).

kLED at Donation Coder

Wireless Keyboard Indicator at Softpedia

DK Keyboard Status at DKpcCode

It's possibly one of those things where my technical curiosity outweighs the practical usefulness of any solution but any pointers you might be able to give me would be much appreciated thank you : )
sicknero is offline   Reply With Quote
Old 01. Jul 2014, 04:27 PM   #4 (permalink)
Senior Edtor
 
v.laurie's Avatar
 
Join Date: Jul 2010
Posts: 1,380
Default

Well, all I can say is that the script from Askvg is pretty standard. I wrote one for XP very similar to it nearly 10 years ago. I don't know how your OSD programs work so I can't comment on what is causing your Numlock behavior. My only wild stab in the dark is to wonder if using Sendkeys and the key F5 to refresh is somehow involved. Sorry to be of no help.
__________________
Vic
v.laurie is offline   Reply With Quote
Old 01. Jul 2014, 08:16 PM   #5 (permalink)
Senior Member
 
sicknero's Avatar
 
Join Date: Mar 2012
Location: England
Posts: 657
Default

Actually that was a great help thank you

Deleting the Sendkeys F5 line from the script has done the trick perfectly.
sicknero is offline   Reply With Quote
Old 01. Jul 2014, 08:28 PM   #6 (permalink)
Senior Edtor
 
v.laurie's Avatar
 
Join Date: Jul 2010
Posts: 1,380
Default

Glad that worked out.
__________________
Vic
v.laurie is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT +1. The time now is 06:10 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.