Hello everyone, I'm new here and I'm looking for a little help.
I need a simple bat code that will automatically change the position of the mouse to any corner of the screen (or extremity) every time the user logs in.
The idea is that users (on my network) are not allowed to use the mouse. And its positioning in the middle of the screen makes the reading of certain information sometimes hard (mouse gets in the way).
So that's it, a simple bat code to automatically reposition the mouse after logging.
Much appreciated and thank you for your time and help.
Simple code for mouse positionning.
Moderator: DosItHelp
Re: Simple code for mouse positionning.
Can you use third party programs on the servers?
You might have to use one to reposition the mouse, or maybe a VBS script can do it - if you have Windows Scripting Host enabled on the server.
Plain vanilla batch can't do it, but may be able to help with a tool.
You might have to use one to reposition the mouse, or maybe a VBS script can do it - if you have Windows Scripting Host enabled on the server.
Plain vanilla batch can't do it, but may be able to help with a tool.
Re: Simple code for mouse positionning.
a vbscript here can do this.
it will need a small adjustment to make it move to the corner and require Excel
it will need a small adjustment to make it move to the corner and require Excel
Re: Simple code for mouse positionning.
I modified it it will move the mouse to the left top corner
Code Editied
Code Editied
Option Explicit
Dim Excel, GetMessagePos, x, y, Count, Position
Set Excel = Wscript.CreateObject("Excel.Application")
GetMessagePos = excel.ExecuteExcel4Macro("CALL(""user32"",""GetMessagePos"",""J"")")
x = CLng("&H" & Right(Hex(GetMessagePos), 4))
y = CLng("&H" & Left(Hex(GetMessagePos), (Len(Hex(GetMessagePos)) - 4)))
Position = "- 600"
Excel.ExecuteExcel4Macro("CALL(""user32"",""SetCursorPos"",""JJJ""," & x & " " & Position & "," & y & " " & Position & ")")
Re: Simple code for mouse positionning.
http://www.nirsoft.net/utils/nircmd2.html
Setcursor at that page is a free tool your sysadmin can use to set the cursor position.
Setcursor at that page is a free tool your sysadmin can use to set the cursor position.
Re: Simple code for mouse positionning.
rachadleb wrote:I need a simple bat code that will automatically change the position of the mouse to any corner of the screen (or extremity) every time the user logs in.
Code: Select all
@rundll32.exe user32.dll,SetCursorPos
Re: Simple code for mouse positionning.
Ed Dyreen wrote:Code: Select all
@rundll32.exe user32.dll,SetCursorPos
Good one Ed. It works in Win 7 too.
Re: Simple code for mouse positionning.
I'm sorry I wasn't available, i was working on site.
Many thanks to everyone that answered this post and especially for Ed that gave the most simple and efficient solution.
I will implement it shortly.
It's good to see that forums still can handle requests one can't find on Google!
Again, to all that took the time to respond, my sincere gratitude.
Many thanks to everyone that answered this post and especially for Ed that gave the most simple and efficient solution.
I will implement it shortly.
It's good to see that forums still can handle requests one can't find on Google!
Again, to all that took the time to respond, my sincere gratitude.