Prev: vbs to read 3rd column field data & check if exist in other file
Next: Simple hack to get $800 to your home.
From: Blinds Nottingham on 6 Jun 2010 08:57 Hi I am a script noobie so just feeling around.. I have users which tend to drag and drop folders on a network share in other folders by not watching what they are doing and saw an article explaining about using the mouse drag and height functions of the windows registry to make it harder for the accidental drag, and saw an article about using the api rather than doing my normal registry imports so thinking this must be accessible the wsh / vbscript Quote By the way, the function for changing the drag threshold is SystemParametersInfo; check out the SPI_SETDRAGHEIGHT and SPI_SETDRAGWIDTH parameters. Pre-emptive correction: Do not modify the registry directly. Use the API. That's why it's there. Unquote But i think this more of vb thing.. so i am looking of how to do this in vbscript or go back to .reg imports.. My only none understanding is by doing it through a wsh rather a regedit.. is it instantaneous when you use the api, also can i set this a machine level as well as user level.. and how do i do that Thanks for any responses to shed some light
From: Mayayana on 6 Jun 2010 11:01
First, I don't know whether those settings will help with people who just don't pay attention... so i'll just address how to do it rather than whether you should do it. I'm guessing the setting you're talking about is probably this, though I'm not certain: HKEY_CURRENT_USER\Control Panel\Desktop\DragHeight HKEY_CURRENT_USER\Control Panel\Desktop\DragWidth You can use the WScript.Shell object to write those values using the RegWrite method. If you don't already have the help file that explains that method, see here: http://www.microsoft.com/downloads/details.aspx?familyid=01592c48-207d-4be1-8a76-1c4099d7bbb9&displaylang=en | But i think this more of vb thing.. so i am looking of how to do this | in vbscript or go back to .reg imports.. | | My only none understanding is by doing it through a wsh rather a | regedit.. is it instantaneous when you use the api, VB and VBScript are not the same thing. To use API calls you can use VB (not to be confused with VB.Net, which can also do API calls....sort of). VBScript does not do API calls. If you write compiled code (VB, C++, etc.) you can call SystemParametersInfo and force an immediate update. If you change the setting via script you'll need to then re-boot, and it's not guaranteed the setting will take. You'd need to test it. If you're already using .reg files that work, and you're not planning to start writing compiled software, it probably makes more sense to just stick with the .reg files. | also can i set | this a machine level as well as user level.. and how do i do that | I doubt it. It's a user preference. |